开发者

Help with basic shell script. /bin/sh: source: not found

开发者 https://www.devze.com 2023-01-02 02:04 出处:网络
My cron : 45 10 * * * source /home/ThinkCode/Test/hello.sh hello.sh : #!/bin/bash echo \"helloworld\" The error it emails me :

My cron :

45 10 * * * source /home/ThinkCode/Test/hello.sh

hello.sh :

#!/bin/bash
echo "helloworld"

The error it emails me :

/bin/sh: source: not found
开发者_JAVA百科

What am I doing wrong? It is configuration/environment specific, so Googling didn't help much! Thanks..


Real sh doesn't have source, only .. Either change the shell in cron to bash, or use . instead.


Why are you sourceing the file from cron. Why not just execute it?

0

精彩评论

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