开发者

at command strange behaviour

开发者 https://www.devze.com 2023-01-31 04:55 出处:网络
This is the first time i am playing with the at command in linux and notice something strange. Say i create this test file:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号