[mythtv-users] Script to keep DCT-6xxx boxes alive

Tom Greer trgreer at gmail.com
Wed Jul 11 18:52:36 UTC 2007


On 7/11/07, Steven Adeff <adeffs.mythtv at gmail.com> wrote:
> I'm getting this when running the script as root, any ideas?
>
> ./keep_dct_alive.sh: 24: Syntax error: "(" unexpected
> --
> Steve

Steve,

I encountered the same thing.  I wasn't sure whether my problem was
distro-related or more global.

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.

I did two things to fix the problem.  I believe that either one will work.

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....)

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.

Problem solved.

Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20070711/cb87609a/attachment.htm 


More information about the mythtv-users mailing list