LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   bash problem (https://www.linuxquestions.org/questions/linux-newbie-8/bash-problem-4175467211/)

MartenH 06-24-2013 03:35 PM

bash problem
 
Hello,

my script ran fine on my old server, after copying to the new it will no longer run.

I get this when running
Code:

./bandyscript.sh: 35: ./bandyscript.sh: Syntax error: "(" unexpected (expecting "done")
This is the offending code:
Code:

for team in 1 5
do
somevar=(`echo "select ID, Datum, SentMail from Games g where Datum >= CURDATE() and Team=$team order by Datum asc LIMIT 1" | mysql -h $IP_ADDR -u$USER_NAME -p$PASSWORD $TABLE_NAME`)
game=${somevar[3]}
...
...
done

Row 35 is the one assigning a value to somevar



Turns out changing /bin/sh to /bin/bash solved it.

chrism01 06-24-2013 07:38 PM

Please use the Forum tools to mark this Solved

MartenH 06-26-2013 02:58 PM

I already did...


All times are GMT -5. The time now is 07:17 AM.