array declaration of shellscript doesnot work in scheduled cron job?
问题 I have created a shell script named "script.sh" which reads an arrays elements and prints it on terminal. The script is as follows: arr=("hello" "world") for i in ${arr[@]} do echo $i; done It gives expected output i.e 'Hello World' on executing it in terminal, but if I schedule the same script in crontab jobs to get executed automatically every minute and store the output in another file,the job fails and gives /home/vikash/script.sh: 1: Syntax error: "(" unexpected error. The crontab job to