This command made the script run correctly. –Murat Aug 24 '15 at 12:10 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using joshuaduan Shell Programming and Scripting 8 05-14-2007 10:02 AM All times are GMT -4. What dice mechanic gives a bell curve distribution that narrows and increases mean as skill increases? asked 1 year ago viewed 726 times active 1 year ago Related 19-bash: syntax error near unexpected token `newline'3bash: syntax error near unexpected token4Confusing syntax error near unexpected token 'done'2Bash syntax his comment is here
asked 1 year ago viewed 218 times active 1 year ago Linked 114 Remove carriage return in Unix Related 0Syntax error near unexpected token `done'0syntax error near unexpected token `}'10BASH Syntax Out of curiosity, what did you think the done was for, and why did you add it to the script? I imagine very few shells in use today would spawn a new process. –William Pursell May 10 '12 at 15:36 add a comment| up vote 1 down vote You could replace Syntax...
Should a country name in a country selection list be the country's local name? asked 3 years ago viewed 10117 times active 2 years ago Related 4Shell Script - syntax error near unexpected token `else'2command not found and syntax error near unexpected token2bash: syntax error Well, it is called !learning the hard way!" Logged Print Pages:  Go Up « previous next » PCLinuxOS-Forums » Help » General » bash "while" loop [SOLVED] SMF 2.0.11
done < $file Remove advertisements Sponsored Links jlliagre View Public Profile Find all posts by jlliagre
If edit in windows notepad any space take it as ^M. Syntax Error Near Unexpected Token Do In Shell Script If it doesn't mark the end of a loop, it's a syntax error. How should I tell my employer? Make text field readonly Close current window shortcut Did millions of illegal immigrants vote in the 2016 USA election?
It says I have some typo error but I can't figure what's wrong at all. Syntax Error Near Unexpected Token Done' Cygwin French vs Italian resistance Outlet w/3 neutrals, 3 hots, 1 ground? UNIX is a registered trademark of The Open Group. Is an internal HDD with Ubuntu automatically bootable from an external USB case?
errorCount=0 while read filename do echo "$filename" if [ -s $filename ] then tail -10 $filename | grep date '+%Y-%m-%d' >> $lastlines1 echo "- Next Error File - " >> $lastlines1 It does make finding syntax errors easier though... Syntax Error Near Unexpected Token Done' For Loop In fact, the ( ) may not be necessary –Random832 Apr 11 '11 at 3:01 it worked!!!! While Loop Syntax Error Near Unexpected Token Done asked 1 year ago viewed 3959 times active 1 year ago Related 1/shell-script: syntax error near unexpected token `done'2bash: syntax error near unexpected token `('-1Syntax error in bash script: near unexpected
It was quite un-understandable at first, I think Word's hidden characters and/or formatting were the issue. this content I see that you have run the file through dos2unix but I would still recommend you run it through something similar once more: tr -d '\015' < src.sh > dst.sh share|improve I'm pretty sure the problem is that #./bin/bash should read #!/bin/bash. –paddy Jul 13 '15 at 21:01 | show 13 more comments 2 Answers 2 active oldest votes up vote 2 I understood.
The script will append to final.txt only if the curl ... | grep ... Help my maniacal wife decorate our christmas tree Is there any financial benefit to being paid bi-weekly over monthly? Can a free radical be created by chemical reaction of non-radical species? weblink How secure is a fingerprint sensor versus a standard password?
but why is your loop empty? –Ja͢ck May 10 '12 at 12:48 add a comment| up vote 1 down vote You need to have something in your loop otherwise bash complains. Syntax Error Near Unexpected Token Do Mac If you are trying to only echo no errors once if no files are found, you need to use a flag to indicate it. A pilot's messages Make text field readonly Eating Skittles Like a Normal Person How to decrypt .lock files from ransomeware on Windows Did millions of illegal immigrants vote in the 2016
Learn about printf (search here on S.O. What are some counter-intuitive results in mathematics that involve only finite objects? Change syntax of macro, to go inside braces split strings and add them as new row TV episode or movie where people on planet only live a hundred days and fall Also, beware that the [$err == 0] line expands the value of $err, which is probably an empty string, unless it has been exported.
What are the ground and flight requirements for high performance endorsement? asked 4 years ago viewed 15466 times active 4 years ago Related 0Syntax error near unexpected token `done'3syntax error near unexpected token `('3-bash: syntax error near unexpected token `)'1cygwin syntax error isn't it ? –Rahul Patil Jan 2 '13 at 12:34 It depends a lot on the user's environment. share|improve this answer edited May 10 '12 at 16:32 answered May 10 '12 at 13:16 chepner 146k12127204 1 : is the correct no-op, but 'true' has been a builtin for
It just means where the shell becomes aware of the problem, not necessarily where it is. –Fiximan Aug 24 '15 at 8:15 | show 5 more comments 1 Answer 1 active y/n; read yn; if [ $yn = y ]; then exit; fi; donespace after the opening square bracked and space before the closing square bracket.semicolon must be immediately after the while My code is: for var in bent bound bled bred brought built burned burnt bought caught clung crept dealt dug dived dreamed dreamt fed felt fought found fled flung ground hung Is the partition function of non-conformal theories on a torus modular invariant?