# 'at' command output on Mac

I need to execute scheduled tasks with at command:

echo "VM-run.sh $1" | at 08.00 > at_output.txt 2>&1  I would have the output of VM-run.sh, but what I have instead is this output: job 5 at Fri Sep 23 08:00:00 2011  - ## 1 Answer That is because you're echoing the output of $ at 08.00 into at_output.txt.

$at 08:00 ./VM-run.sh > at_output.txt ^D  Then you'll get a confirmation like this. job 1 at Sat Sep 24 08:00:00 2011  Edit: Alternatively for shell scripts, you can restructure the command like this. #!/bin/bash ./VM-run.sh > at_output.txt | at 08:00  - I have to schedule the AT command in a script so I cannot input the AT from keyboard – robob Sep 23 '11 at 6:37 @robob See edit. :) – Jin Sep 23 '11 at 6:47 I think it's the right answer :-) In the night I'll check and I'll give you the answer ok. Thanks a lot – robob Sep 23 '11 at 12:11 I try to run "echo "VM-run.sh$1 > at_output.txt" | at 18.40" but nothing happens –  robob Sep 23 '11 at 16:53
You're echoing the string literal "VM-run.sh \$1 > output.txt". What you want to do, from what I understand, is to run the VM-run.sh script and echo the output into the at_output.txt, which is taken care of by the > character in my solution. –  Jin Sep 24 '11 at 3:52