waspsoft.com


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

Bash For Loop Syntax Error Near Unexpected Token

Contents

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 How would family relationships change if legal system uses collective punishment? Which is wrong in shell (and most other computer languages). Sign into your account, or create a new one, to start interacting. navigate here

Good way to explain fundamental theorem of arithmetic? Adopt A Jet/Book Intuition behind Harmonic Analysis in Analytic Number Theory In a GNU C macro envSet(name), what does (void) "" name mean? Log In Sign Up Report a Bug Use this form to report bugs related to the Community Review your favorite Linux distribution. Is my workplace warning for texting my boss's private phone at night justified?

Bash Syntax Error Near Unexpected Token Done'

Is 8:00 AM an unreasonable time to meet with my graduate students and post-doc? Well, it is called !learning the hard way!" Logged Print Pages: [1] Go Up « previous next » PCLinuxOS-Forums » Help » General » bash "while" loop [SOLVED] SMF 2.0.11 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 Now I know my ABCs, won't you come and golf with me?

Integral using residue theorem complex analysis What does an 'ü' mean? Is it possible to check for existence of member template just by identifier? UNIX is a registered trademark of The Open Group. Bash Syntax Error Near Unexpected Token Fi' Member Posts: 448 bash "while" loop [SOLVED] « on: December 11, 2014, 03:02:00 PM » Hi,I am finally starting to learn bash scripting, and am having a problem with the 'while'

Not the answer you're looking for? Good luck. –shellter May 10 '12 at 13:14 5 A valid "no-op" command is : –glenn jackman May 10 '12 at 13:37 1 @glennjackman : yes, good point. Subtraction with a negative result What type of sequences are escape sequences starting with "\033]" Symbolic comparison of recursive functions Password Protected Wifi, page without HTTPS - why the data is Can Customs make me go back to return my electronic equipment or is it a scam?

You apparently have Windows line endings in your script... –jasonwryan Sep 25 '14 at 8:38 @jasonwryan i fixed it –Educ Sep 25 '14 at 17:00 add a comment| 1 Bash Syntax Error Near Unexpected Token Then' Browse other questions tagged bash shell-script newlines or ask your own question. Cheers. What does Sauron need with mithril?

Bash Syntax Error Near Unexpected Token Echo'

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 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: Bash Syntax Error Near Unexpected Token Done' 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 Bash Syntax Error Near Unexpected Token (' Ubuntu share|improve this answer edited Sep 26 '14 at 20:41 answered Jan 2 '13 at 12:29 peterph 17.9k13045 add a comment| up vote 1 down vote You need to use vim editor

Logged shimonl Sr. check over here You are currently viewing LQ as a guest. Please click the link in the confirmation email to activate your subscription. Thank you so much. Bash Syntax Error Near Unexpected Token Else'

Join them; it only takes a minute: Sign up Confusing syntax error near unexpected token 'done' up vote 4 down vote favorite I am trying to learn shell scripting, so I What does an 'ü' mean? Above we don't see the PS4 (xtrace) output. –Stéphane Chazelas Aug 24 '15 at 7:06 2 What does file test.sh say? http://waspsoft.com/syntax-error/bash-for-syntax-error-near-unexpected-token.html Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

Thanks a lot. Bash Syntax Error Near Unexpected Token Do' spectral norm of block-wise sums of matrices Yes, of course I'm an adult! I have a script name "loop.sh" with this code: #!/bin/bash while : do sl done When I try to run it with command "bash loop.sh" there's error: syntax error near unexpected

The 'file' command should tell you what they are (if that command is available on the Unix you are on).

Changed your mind? Please visit this page to clear all LQ-related cookies. 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 Bash Syntax Error Near Unexpected Token Newline' Is there a good way to get from Levoča to Lviv?

You previously marked this answer as accepted. A question can only have one accepted answer. Does mean=mode imply a symmetric distribution? weblink 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

This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. asked 4 years ago viewed 14620 times active 3 years ago Related 0Syntax error near unexpected token `done'3syntax error near unexpected token `('0Syntax error near unexpected token “(”, indirect expansion variable How to pluralize "State of the Union" without an additional noun? Subscribed!

I have my share of cases where the script complain at line 150 and the problem as on a misquote in a completed different line. –BitsOfNix Aug 24 '15 at 7:25 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 Realism of a setting with several sapient anthropomorphic animal species Skeletal formula for carbon with two double bonds Problem with using pause and onslide in one frame Is the standard Canon