문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top