at command strange behaviour
This is the first time i am playing with the at command in linux and notice something strange. Say i create this test file:
#!/bin/bash
count=1
echo "count is $count"
then i issue开发者_运维技巧
at -f /full/path/to/myscript.sh -v 13:00 -m
and wait for it to run. Then in my mail, the value of count variable is nothing. What could be wrong?
To: root@localhost.localdomain
Status: R
count is
&
Are you sure your commands are being run by bash, and not some other interpreter like csh? I don't think the shebang line has any effect in an at job -- the commands are simply piped into whichever shell is specified via the SHELL environment variable.
精彩评论