LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-24-2013, 03:35 PM   #1
MartenH
Member
 
Registered: Jul 2005
Location: Lund, Sweden
Distribution: Debian
Posts: 78

Rep: Reputation: 23
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.

Last edited by MartenH; 06-24-2013 at 03:40 PM. Reason: Solved it
 
Old 06-24-2013, 07:38 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Please use the Forum tools to mark this Solved
 
Old 06-26-2013, 02:58 PM   #3
MartenH
Member
 
Registered: Jul 2005
Location: Lund, Sweden
Distribution: Debian
Posts: 78

Original Poster
Rep: Reputation: 23
I already did...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash problem : -bash: [: /bin/bash: unary operator expected J.A.X Linux - Software 1 09-22-2011 05:52 AM
Bash BC problem mcfc1900 Programming 4 04-05-2011 03:57 PM
[SOLVED] bash : getopts problem in bash script. angel115 Programming 2 03-02-2009 10:53 AM
Reading a bash variable in bash scripting problem freeindy Programming 3 11-27-2008 02:29 AM
bash problem cL4YmAN Linux - Newbie 1 06-07-2004 01:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration