![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| for loop syntax trouble | visitorQ | Shell Programming and Scripting | 9 | 04-12-2008 11:53 PM |
| awk Shell Script error : "Syntax Error : `Split' unexpected | Herry | UNIX for Dummies Questions & Answers | 2 | 03-17-2008 07:16 AM |
| I got error like...syntax error on line 1, teletype | koti_rama | UNIX for Advanced & Expert Users | 2 | 07-07-2007 04:35 PM |
| for loop not working - syntax error at line 6: `end of file' unexpected | debojyoty | Shell Programming and Scripting | 2 | 03-10-2006 11:45 AM |
| Syntax error.. | livetaurean19 | Shell Programming and Scripting | 0 | 06-14-2005 01:23 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
syntax error in while loop
Hi,
I have the following script (compile_mercury) and I get this error: I have no idea why...and I have written this script completely in linux (bash) and not in windows. **************** ./compile_mercury: line 136: syntax error near unexpected token `done' ./compile_mercury: line 136: `done' **************** Here is the script. Line 136 is the second 'done' statement. ************ semi=2 while [ $semi -le 7 ] semi2=0 while [ $semi2 -le 90 ] e=1 while [ $e -le 12 ] do ..... .... e=`expr $e + 1` done semi2=`expr $semi2 + 10` done semi=`expr $semi + 1` done *************** Thanks |
| Forum Sponsor | ||
|
|
|
|||
|
Without seeing the whole script, it's very hard to say. It's not uncommon for this error message to be caused by a quoting problem somewhere pretty far from the line indicated by the error message; if a misplaced quote hides a "fi" from the shell, it will still be looking for it when it gets to a "done" much later, and complain about the "done". (You seem to be missing a "do" after "while [ $semi2 -le 90 ]"; perhaps this is related.)
I hope you have indentation in your actual script to show the structure, especially if it's that long. You might want to use code tags when posting code snippets in the future. |
|||
| Google UNIX.COM |