theo-brown
theo-brown

Reputation: 870

Using at to run a .txt file or command with flags

I need to run (in bash) a .txt file containing a bunch of commands written to it by another program, at a specific time using at. Normally I would run this with bash myfile.txt but of I choose to run at bash myfile.txt midnight it doesn't like it, saying

syntax error. Last token seen: b
Garbled time

How can I sort this out?

Upvotes: 0

Views: 192

Answers (1)

Ruud Helderman
Ruud Helderman

Reputation: 11018

Try this instead:

echo 'bash myfile.txt' | at midnight

at reads commands from standard input or a specified file (parameter -f filename); not from the command line.

Upvotes: 1

Related Questions