我编写了一个 KornShell (ksh) 脚本,它通过以下方式设置数组:
set -A fruits Apple Orange Banana Strawberry
但是当我试图从 cron 中运行它时,它会引发以下错误:
Your "cron" job on myhost
/myScript.sh
produced the following output:
myScript.sh: -A: bad option(s)
我尝试了许多 crontab 语法变体,例如:
尝试1:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /path/to/script/myScript.sh
尝试2:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /path/to/script/./myScript.sh
尝试 3:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * cd /path/to/script && ./myScript.sh
任何解决方法将不胜感激。提前非常感谢!