Script runs in command-line fine but times out in CRON?

Hi, I have a script that seems to run to completion when in the command-line, but when it is run using the cron, it seems to time out.

They both start and run fine, but on the CRON it stops prematurely.

The script hits an API every few seconds and grabs data.

Does anyone have any idea on why this could be?

You did not post the script, so hard to tell.

Perhaps you are missing the shebang. Read here for the important first line

Sorry, here it is, relatively simple.
Is the bashshebang comment relevant even though the script successfully starts? - At the moment I have no bashshebang in my script but, didn't think this was an issue since it still runs.


../stocks/aaa-stockuniverse.txt

stock="soda"

eval $(curl -s "http://www.web.com/ig/api?stock=$stock"|sed 's/</\n</g' |sed '/data=/!d; s/ data=/=/g; s/\/>/; /g; s/</GF_/g' |tee ~/stocks/$stock.txt)




while read line
do
    array+=("$line")
done < "/home5/username/stocks/aaa-stockuniverse.txt"

for ((i=0; i < ${#array[*]}; i++))
do
	eval $(curl -s "http://www.web.com/ig/api?stock=${array}"|sed 's/</\n</g' |sed '/data=/!d; s/ data=/=/g; s/\/>/; /g; s/</GF_/g' |tee /home5/username/public_html/dailyquotes/${array}.txt)
	echo "${array},$(date +%Y-%m-%d),$GF_open,$GF_high,$GF_low,$GF_last,$GF_volume"
	sleep $[ ( $RANDOM % 10 )  + 1 ]s
done


Please read this regarding the need for the shebang

thanks joeyg, I've added #!/bin/bash

The script is set to run again tonight via cron, will update everyone.