Home > Syntax Error > Bash For Loop Syntax Error Near Unexpected Token

Bash For Loop Syntax Error Near Unexpected Token

Contents

Yes, of course I'm an adult! Were slings used for throwing hand grenades? Realism of a setting with several sapient anthropomorphic animal species Is the following extension of finite state automata studied? Not the answer you're looking for? this contact form

Is it possible to check for existence of member template just by identifier? Share your knowledge. Intuition behind Harmonic Analysis in Analytic Number Theory How does Gandalf get informed of Bilbo's 111st birthday party? Main Menu LQ Calendar LQ Rules LQ Sitemap Site FAQ View New Posts View Latest Posts Zero Reply Threads LQ Wiki Most Wanted Jeremy's Blog Report LQ Bug Syndicate Latest

Bash Syntax Error Near Unexpected Token Done'

Reply Log In to Comment 0 dinhhoangviet May 18, 2014 I copied and created new file with the code in example of the link: #!/bin/bash COUNTER=0 while [ $COUNTER -lt 10 Fenerlitk , note that the ':' no-op command could have been put in your loop, preceding you comment, i.e. : # do something, and that loop would have finished, but you I can't see anything wrong with my code, and I can't find similar examples that involve multiple statements in one line bash shell-script scripting share|improve this question edited Oct 28 '15 Contact Us - Advertising Info - Rules - LQ Merchandise - Donations - Contributing Member - LQ Sitemap - Main Menu Linux Forum Android Forum Chrome OS Forum Search LQ

Still learning bash... –9a3eedi Oct 28 '15 at 7:00 @9a3eedi Can you post that whole compound command, where you get the syntax error? –chaos Oct 28 '15 at 7:19 Unix & Linux Stack Exchange works best with JavaScript enabled current community chat Unix & Linux Unix & Linux Meta your communities Sign up or log in to customize your list. Sign Up Log In submit Tutorials Questions Projects Meetups Main Site logo-horizontal DigitalOcean Community Menu Tutorials Questions Projects Meetups Main Site Sign Up Log In submit View All Results By: dinhhoangviet Bash Syntax Error Near Unexpected Token Fi' How to map and sum a list fast?

Are you new to LinuxQuestions.org? This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. Browse other questions tagged shell or ask your own question. Log In to Comment 4 Answers 0 sianios May 18, 2014 Replace : with ; See here for more examples http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-7.html Reply Log In to Comment 0 dinhhoangviet May 18, 2014

If you'd like to contribute content, let us know. Bash Syntax Error Near Unexpected Token Then' Hope the file for example with vim and enable the syntax check. current community chat Stack Overflow Meta Stack Overflow your communities Sign up or log in to customize your list. Introduction to Linux - A Hands on Guide This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started

Bash Syntax Error Near Unexpected Token Echo'

How to map and sum a list fast? Limit involving exponentials and arctangent without L'Hôpital Which requires more energy: walking 1 km or cycling 1 km at the same speed? Bash Syntax Error Near Unexpected Token Done' Can Customs make me go back to return my electronic equipment or is it a scam? Bash Syntax Error Near Unexpected Token (' Ubuntu Unix & Linux Stack Exchange works best with JavaScript enabled current community chat Unix & Linux Unix & Linux Meta your communities Sign up or log in to customize your list.

Why is this the case? weblink you should mention what Unix you are running. Search this Thread 08-15-2011, 05:52 AM #1 rmaier9 LQ Newbie Registered: Aug 2011 Posts: 2 Rep: Bash script problem: syntax error near unexpected token `do Hello, I am having What could cause the throttle to stick in my Ford Ranger? Bash Syntax Error Near Unexpected Token Else'

bash for-loop debian share|improve this question asked Aug 15 '11 at 8:43 leon 1,47431425 add a comment| 3 Answers 3 active oldest votes up vote 5 down vote Use the -c Not the answer you're looking for? up vote 3 down vote Let's add some new lines and indentation: 1 while read filename; do 2 echo "$filename" 3 if [ -s $filename ]; then 4 tail -10 $filename http://sovidi.com/syntax-error/bash-for-syntax-error-near-unexpected-token.php Does mean=mode imply a symmetric distribution?

Subtraction with a negative result What does the "Phi" sign stand for in musical notation? Bash Syntax Error Near Unexpected Token Do' How rich can one single time travelling person actually become? And I think you want an explicit path to the file in your remove command. (If you have a script with references to a particularly long path or one that is

If you had edited/created this on a windows machine and copied to *nix, a 'dos2unix' will fix this.

Try with only -x to see where it first stops to make sense. UNIX is a registered trademark of The Open Group. more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed Bash Syntax Error Near Unexpected Token Newline' Can Customs make me go back to return my electronic equipment or is it a scam?

The read and write part is executed by the 'heatFluxGather' code. more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed Password Programming This forum is for all programming questions. his comment is here Is there a good way to get from Levoča to Lviv?

Are there any 'smart' ejection seats? tommylovell View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by tommylovell 08-15-2011, 09:15 AM #3 rmaier9 LQ Newbie Registered: Aug 2011 Posts: more hot questions question feed default about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation What are the holes on the sides of a computer case frame for?

Is the standard Canon 18-55 lens the same as 5 years ago? more hot questions question feed lang-sh about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation 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 Not the answer you're looking for?

share|improve this answer edited May 10 '12 at 22:31 answered May 10 '12 at 12:52 Thor 19.8k54774 2 I'd call not processing an empty loop a feature! ;-) Good luck Syntax...