On 7/11/07, Steven Adeff <<a href="mailto:adeffs.mythtv@gmail.com">adeffs.mythtv@gmail.com</a>> wrote:<br>> I'm getting this when running the script as root, any ideas?<br>> <br>> ./keep_dct_alive.sh: 24: Syntax error: "(" unexpected
<br>> --<br>> Steve<br><br>Steve, <br><br>I encountered the same thing. I wasn't sure whether my problem was distro-related or more global.<br><br>The root cause of the problem is that, as a default, cron executes scripts using the Bourne (sh) shell, which does not support array variables.
<br><br>I did two things to fix the problem. I believe that either one will work. <br><br>First of all, I changed /etc/crontab, replacing the line "SHELL=/bin/sh" to "SHELL=/bin/bash". That did not immediately fix the problem (probably because I didn't restart cron....)
<br><br>So then I read somewhere that if the line "#!/bin/bash" is the first line in a shell script, that cron will execute the file is the specified shell. I had this as the second line. So I moved to to line 1.
<br><br>Problem solved.<br><br>Tom<br>