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

Bash For Loop Syntax Error Near Unexpected Token

Contents

Now I know my ABCs, won't you come and golf with me? How to deal with a really persuasive character? asked 3 years ago viewed 9434 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 Also, notice that you should quote your variables: wget --no-check-certificate --directory-prefix="${tempFolder}" "${i}" share|improve this answer edited Oct 28 '15 at 7:18 answered Oct 28 '15 at 6:54 chaos 27.4k65095 http://gatoisland.com/syntax-error/bash-for-loop-syntax-error-unexpected-end-of-file.php

This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. The bash just retrieves the data. 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' share|improve this answer edited May 10 '12 at 16:32 answered May 10 '12 at 13:16 chepner 136k12119194 1 : is the correct no-op, but 'true' has been a builtin for

Bash Syntax Error Near Unexpected Token Done'

You previously marked this answer as accepted. Browse other questions tagged bash shell-script scripting or ask your own question. Convince people not to share their password with trusted others How's the CMD trip bonuses from extra legs work? Yes, of course I'm an adult!

For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the 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 Fi' Skipping directly to level 4 GTIN validation What to tell to a rejected candidate?

This site is not affiliated with Linus Torvalds or The Open Group in any way. Password Programming This forum is for all programming questions. How rich can one single time travelling person actually become? 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

UNIX is a registered trademark of The Open Group. Bash Syntax Error Near Unexpected Token Then' UNIX is a registered trademark of The Open Group. Join them; it only takes a minute: Sign up Shell | syntax error near unexpected token `(' before for loop up vote 0 down vote favorite I have following code snippet how could I knew what was your intended use ?

Bash Syntax Error Near Unexpected Token Echo'

What to tell to a rejected candidate? 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 Bash Syntax Error Near Unexpected Token Done' Learn about printf (search here on S.O. Bash Syntax Error Near Unexpected Token (' Ubuntu Will the medium be able to last 100 years?

You will be missed. weblink This has been bothering me for a while now. You should use -c option if you don't put it in a file. Not the answer you're looking for? Bash Syntax Error Near Unexpected Token Else'

I understood. Thanks again (but next time maybe be a bit more explicit in your warnings?) LOLOL You wrote the script ... In other words the while-do-done and if-then-else-fi clauses are overlapping. Not the answer you're looking for? http://gatoisland.com/syntax-error/bash-for-syntax-error-near-unexpected-token.php How to book a flight if my passport doesn't state my gender?

You sometimes get this sort of problem when you do a binary ftp of an ascii file from one system to another, like from MS to Linux or Unix, or Mac Bash Syntax Error Near Unexpected Token Do' Thanks a lot. This site is not affiliated with Linus Torvalds or The Open Group in any way.

Community Tutorials Questions Projects Tags Newsletter RSS Distros & One-Click Apps Terms, Privacy, & Copyright Security Report a Bug Get Paid to Write Almost there!

Hope the file for example with vim and enable the syntax check. Is 8:00 AM an unreasonable time to meet with my graduate students and post-doc? Were slings used for throwing hand grenades? Bash Syntax Error Near Unexpected Token Newline' Is there a good way to get from Levoča to Lviv?

Why is a semicolon needed only inside a for loop, but not outside of it? –9a3eedi Oct 28 '15 at 6:59 And thanks for noticing my other unrelated mistake There's error: line 6: syntax error near unexpected token `done' Why bash programing is too hard??? Not the answer you're looking for? http://gatoisland.com/syntax-error/bash-script-syntax-error-near-unexpected-token.php share|improve this answer answered Sep 25 '14 at 8:42 Sreeraj 2,26521328 Thanks so much its works fine –Educ Sep 25 '14 at 8:48 add a comment| Your Answer

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 Is there a way to make a metal sword resistant to lava? are shell scripts 'tab sensitive'? share|improve this answer answered May 10 '12 at 12:42 Ja͢ck 122k19154199 what do you mean by that? –fenerlitk May 10 '12 at 12:44 2 do true; done ...

Because here, you're doing bash for i in {1..10} then do echo $i and so on. 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 spectral norm of block-wise sums of matrices Yes, of course I'm an adult! So sayeth the Shepherd Is the empty set homeomorphic to itself?

Adopt A Jet/Book Can a creature benefit from differently typed speed bonuses all named fast movement? while read filename do echo "$filename" if [ -s $filename ] then tail -10 $filename | grep date '+%Y-%m-%d' >> $lastlines1 echo "- Next Error File - " >> $lastlines1 else How to pluralize "State of the Union" without an additional noun? 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

Please visit this page to clear all LQ-related cookies. 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 Not the answer you're looking for? Problem with using pause and onslide in one frame Dennis numbers 2.0 A name for a well-informed person who is not believed?

A name for a well-informed person who is not believed?

© Copyright 2017 gatoisland.com. All rights reserved.