Home > Syntax Error > Syntax Error Near Unexpected Token Do Shell

Syntax Error Near Unexpected Token Do Shell


You previously marked this answer as accepted. 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 Browse other questions tagged linux bash sudo watchdog or ask your own question. Not the answer you're looking for? his comment is here

Yes, I'm sure. asked 7 months ago viewed 748 times active 6 months ago Related 3004Getting the Current/Present working directory of a Bash script from within the script0Syntax error near unexpected token “elif” in Why is bench pressing your bodyweight harder than doing a pushup? asked 3 months ago viewed 346 times active 3 months ago Related 0why syntax error near unexpected token ' fi '0Bash script throws “syntax error near unexpected token `}'” when run5bash:

Syntax Error Near Unexpected Token Do For Loop

Related 4Script doesn't work when executed with sudo3syntax error near unexpected token `('1syntax error near unexpected token `if'0syntax error near unexpected token `fi'21Syntax error near unexpected token 'fi'8syntax error near unexpected Display a Digital Clock Make text field readonly the sum of consecutive odd numbers Hit a curb today, taking a chunk out of the tire and some damage to the rim. Most useful knowledge from the 30's to understand current state of computers & networking?

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 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 Code: DATE=`date` NEWFILE=$OUTFILE$(date +%y%m%d-%H%M%S).${DPDEVICE}.${2} ssh -T ${DPDEVICE} < $INFILE >> $OUTFILE if [ $? -eq 0 ] then echo " Report Logging . . " chmod 777 $NEWFILE mv -if $OUTFILE Do Unexpected In Shell Script up vote 3 down vote There are a bunch of syntax errors here.

bash shell-script newlines share|improve this question edited Aug 24 '15 at 23:00 Gilles 382k727031146 asked Aug 24 '15 at 6:58 Murat 7818 1 Chances are the problem is in the Syntax Error Near Unexpected Token Do In Unix Share it with others to increase its visibility and to get it answered quickly. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. 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

Blogs Recent Entries Best Entries Best Blogs Blog List Search Blogs Home Forums HCL Reviews Tutorials Articles Register Search Search Forums Advanced Search Search Tags Search LQ Wiki Search Tutorials/Articles Search Syntax Error Near Unexpected Token Do R Code: #!/bin/bash Script Creation Date 01/21/2010 Author baraghun ##**************************************************************** ## ********** FUNCTION USAGE *********** ##**************************************************************** Script name without path BASENAME=`basename $0` Script Location LOCATION=/home/myHome The INFILE is going to use during 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 Will majority of population dismiss a video of fight between two supernatural beings?

Syntax Error Near Unexpected Token Do In Unix

Each folder has a .txt file with some data I would like to collect and write into one .txt file. Are you sure you want to replace the current answer with this one? Syntax Error Near Unexpected Token Do For Loop how could I knew what was your intended use ? Syntax Error Near Unexpected Token Do Mac Is it still safe to drive?

Finally, you need a fi (after the ffmpeg line) to end the conditional. this content 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 Browse other questions tagged bash unix ffmpeg or ask your own question. Code: #!/bin/bash # ftp files done < $file errors: Quote: sql.sh: line 18: syntax error near unexpected token `done' 'ql.sh: line 18: `done < $file I tried..with no success: Code: if Syntax Error Near Unexpected Token Done' While Loop

See the examples in the link I gave you above. Last edited by tommylovell; 08-15-2011 at 08:56 AM. French vs Italian resistance Joining two lists with relational operators Why is the Vitamin B complex, a "complex"? http://allconverter.net/syntax-error/syntax-error-near-unexpected-token-done-shell-script.html Plus and Times, Ones and Nines What do you do with all the bodies?

Anyway, here's my quick rewrite: #!/bin/bash # $1 is the first parameter passed # $2 is the second parameter passed # $3 is the third parameter passed for file in *.*; Syntax Error Near Unexpected Token ' In Shell Script change: Code: if [ $key = "RUNNING" ]; then to Code: if [ "$key" = 'RUNNING' ]; then vgersh99 View Public Profile Find all posts by vgersh99

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?

Browse other questions tagged bash shell-script newlines or ask your own question.

Password Programming This forum is for all programming questions. Find all posts by hergp

#7 02-03-2010 raghunsi Registered User Join Date: Nov 2008 Last Activity: 26 July 2016, 1:42 PM EDT Location: bangalore Posts: 107 Thanks: Log In Sign Up Report a Bug Use this form to report bugs related to the Community Report a bug: Name Email Message PCLinuxOS-Forums Main Welcome, Guest. Syntax Error Near Unexpected Token $' R'' As written, the shell is treating "if[" as the name of a command, which isn't what you want at all.

chmod: WARNING: can't access /home/MyHome/out/outFile100203-023547.tmox6324-ra.enable [/output] Created Output Files -rw-r--r-- 1 1957 Feb 3 02:29 outFile100203-022952.tmox6324-ra.enable -rw-r--r-- 1 1958 Feb 3 02:31 outFile100203-023128.tmox6324-ra.disable -rw-r--r-- 1 1957 Feb 3 02:31 outFile100203-023155.tmox6324-ra.enable Browse other questions tagged command-line bash grep regex or ask your own question. 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 check over here In terms of a suggested style, make your variables upper case ("for a in 10 20..." would be "for A in 10 20..."; and "cp ./a$a/b$b/..." and "...heatFluxGather $a $b" would

Could anybody help me, please? Is an internal HDD with Ubuntu automatically bootable from an external USB case? The variable reference "${file%.extension}"$3 will try to remove ".extension" (not the variable, just the string) from the end of $file.