Home > Syntax Error > Bash Script Syntax Error Near Unexpected Token Do

Bash Script Syntax Error Near Unexpected Token Do

Contents

This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. Please visit this page to clear all LQ-related cookies. Symbolic comparison of recursive functions Force Microsoft Word to NEVER auto-capitalize the name of my company Skipping directly to level 4 Is it possible to check for existence of member template Browse other questions tagged bash shell-script scripting or ask your own question. http://gatoisland.com/syntax-error/bash-script-syntax-error-near-unexpected-token.php

if [ "$key" = RUNNING ]; then ... And just as a stylistic thing, you don't need ; at the end of a line in shell; it's only needed when you're putting multiple commands (or things like do and no outgoing connection via ipv4 Is 8:00 AM an unreasonable time to meet with my graduate students and post-doc? Appreciate it!

Linux Syntax Error Near Unexpected Token Then'

bash shell-script newlines share|improve this question edited Aug 24 '15 at 23:00 Gilles 369k666681119 asked Aug 24 '15 at 6:58 Murat 7818 1 Chances are the problem is in the 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 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

Share on Twitter Replace previous answer? asked 11 months ago viewed 769 times active 11 months ago Related 1/shell-script: syntax error near unexpected token `done'2command not found and syntax error near unexpected token2Bash : syntax error near Rosa Parks is a [symbol?] for the civil rights movement? Syntax Error Near Unexpected Token Do R UNIX is a registered trademark of The Open Group.

The time now is 08:47 PM. - Contact Us - Unix & Linux - unix commands, linux commands, linux server, linux ubuntu, shell script, linux distros. - Advertising - Top Linux Syntax Error Near Unexpected Token Newline' 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 Forum Operations by The UNIX and Linux Forums Were slings used for throwing hand grenades?

This is symptomatic of unexpected CR characters in the text file. Syntax Error Unexpected Do Browse other questions tagged bash shell-script newlines or ask your own question. How to book a flight if my passport doesn't state my gender? done instead of Code: while read line do ...

Linux Syntax Error Near Unexpected Token Newline'

rmaier9 View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by rmaier9 08-21-2014, 05:20 AM #4 praju1 LQ Newbie Registered: Aug 2014 Posts: Changed your mind? Linux Syntax Error Near Unexpected Token Then' Click Here to receive this Complete Guide absolutely free. Syntax Error Near Unexpected Token Do For Loop Is it possible to check for existence of member template just by identifier?

So tried with command as : Code: $ dos2unix abc.sh dos2unix: converting file abc.sh to UNIX format ... his comment is here Code: [[email protected] ~]# file heatFlux heatFlux: Bourne-Again shell script, ASCII text executable Code: [[email protected] ~]# unix2dos heatFlux unix2dos: converting file heatFlux to DOS format ... [[email protected] ~]# file heatFlux heatFlux: Bourne-Again Not so much for a normal user on Solaris or a user on an embedded system with limited space... –Gert van den Berg Jan 2 '13 at 12:49 add a comment| 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 Syntax Error Near Unexpected Token Do Mac

Cheers. If bad lineend's are not the case then I can't help. Should indoor ripened tomatoes be used for sauce? this contact form A question can only have one accepted answer.

share|improve this answer answered Feb 24 at 6:27 CodeGnome 2,8461619 1 Ahh, that makes sense now! Syntax Error Near Unexpected Token In Shell Script Will the medium be able to last 100 years? 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.

UNIX is a registered trademark of The Open Group.

share|improve this answer answered Aug 7 '14 at 6:40 tripleee 60k759116 add a comment| up vote 2 down vote for is an internal function (not to be confused with functions) of Browse other questions tagged linux bash sudo watchdog or ask your own question. 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 Unexpected End Of File Bash If they are, the script converts such files to the type of the third parameter using an FFMPEG command.

UNIX is a registered trademark of The Open Group. Share your knowledge. 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 http://gatoisland.com/syntax-error/bash-for-syntax-error-near-unexpected-token.php Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

Share it with others to increase its visibility and to get it answered quickly. American English: are [ə] and [ʌ] different phonemes? On THE other hand or on another hand? Log In to Answer Copyright © 2016 DigitalOcean™ Inc.

more hot questions question feed lang-bsh about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation Hope this helps. The question does not have to be directly related to Linux and any language is fair game. 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

© Copyright 2017 gatoisland.com. All rights reserved.