Home > Syntax Error > Syntax Error Done Unexpected

Syntax Error Done Unexpected

Contents

Does using documentation as a developer make me look unprofessional? You have the line with the 'do' commented out: Code: # Define the hostname of the server SRVNM=`uname -n` while read -r FS MAXCAP do Remove advertisements Sponsored Notice, the path of the file being searched is "/" because you didn't set a value for the variable $ADMINDIR (is commented out). Schengen visa to Norway to visit my wife refused Should a country name in a country selection list be the country's local name? his comment is here

Complimenting the author of a textbook A pilot's messages Am I being a "mean" instructor, denying an extension on a take home exam Why is bench pressing your bodyweight harder than Complimenting the author of a textbook How do I politely decline a research grant? 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 done is a shell keyword.

Syntax Error Near Unexpected Token Done In Shell Script

Is there any financial benefit to being paid bi-weekly over monthly? Did millions of illegal immigrants vote in the 2016 USA election? Not the answer you're looking for?

shell-script share|improve this question edited Jan 2 '13 at 13:14 mtk 4,413184483 asked Jan 2 '13 at 12:19 UNIX Learner 6112 1 some general comments: You probably want to quote Why is the Vitamin B complex, a "complex"? share|improve this answer answered Aug 18 '12 at 12:08 Gilles 382k727031146 1 Thanks clearly a gap in my knowledge, I don't script much so wasn't aware of that! Syntax Error Near Unexpected Token Do For Loop On Ubuntu, /bin/sh is dash, a shell designed for fast startup and execution with only standard features.

But interestingly, on the correct arch the file beginning with #! /bin/sh executed perfectly. Syntax Error Near Unexpected Token Done' For Loop You can easily confirm this is with a simple example: # #!/bin/bash offfset=(`ls`) echo $offset Running this script with sudo will raise a syntax error in recent versions of Ubuntu and Does it give you some message? Browse other questions tagged bash shell-script scripting or ask your own question.

Thank you so much. Bash Syntax Error Near Unexpected Token Do' Instead I reused the same code with semi-colon approach instead. Are there too few Supernova Remnants to support the Milky Way being billions of years old? command succeeds.

Syntax Error Near Unexpected Token Done' For Loop

Reply Log In to Comment Have another answer? As fenerlitk said 'I am trying to learn shell scripting', I figured it made sense that s/he would want to see the loop in action. Syntax Error Near Unexpected Token Done In Shell Script Post it here so everyone can benefit. –Keith Thompson Mar 9 '15 at 21:07 but the code is private :( –Mohammed Nagy Mar 13 '15 at 11:58 | show Syntax Error Near Unexpected Token Do In Shell Script Idiomatic Expression that basically says "What's bad for you is good for me" Can a free radical be created by chemical reaction of non-radical species?

Make text field readonly Joining two lists with relational operators How to decrypt .lock files from ransomeware on Windows Is it a coincidence that the first 4 bytes of a PGP/GPG http://allconverter.net/syntax-error/syntax-error-fi-unexpected.html Try our newsletter Sign up for our newsletter and get our top new questions delivered to your inbox (see an example). Share your knowledge. My code is: #!/bin/bash while : do echo "Press [CTRL+C] to stop.." sleep 1 done Saved it as .sh and ran bash file.sh CentOS 6 32-bit What is the issue? While Loop Syntax Error Near Unexpected Token Done

Share it with others to increase its visibility and to get it answered quickly. Not the answer you're looking for? y/n; read yn; if [$yn = y]; then exit; fi; donebash: syntax error near unexpected token `done'Thanks!Shimon « Last Edit: December 11, 2014, 04:12:30 PM by shimonl » Logged as Guest weblink asked 3 years ago viewed 34975 times active 1 month ago Visit Chat Linked 1 Bash Syntax Error.

You have two options to make sure the script is interpreted by bash: Move the shebang to the first line Run sudo like this: sudo bash ./pi_dev_env_install.sh share|improve this answer answered Syntax Error Near Unexpected Token Do Mac In 5e, do you get to use the extra attack as well when you ready an attack action? What are the ground and flight requirements for high performance endorsement?

Difficulties interpreting this complex sentence Aligning texts side by side with equations in \align environment Is there any financial benefit to being paid bi-weekly over monthly?

You most likely have a carriage return or no-break space in your file. So I started experimenting by removing all the sudo lines and running the whole script via sudo at the command line like so: [email protected]:~$ sudo ./pi_dev_env_install.sh This works fine as expected Am I being a "mean" instructor, denying an extension on a take home exam Can a creature with 0 power attack? Only One String May Be Given When Deleting Without Squeezing Repeats You previously marked this answer as accepted.

Need a way for Earth not to detect an extrasolar civilization that has radio Amplifier circuit woe Letter of Recommendation Without Contact from the Student What is this strange biplane jet the sum of consecutive odd numbers Why do the Avengers have bad radio discipline? Square root image filter tool in Python How secure is a fingerprint sensor versus a standard password? check over here Removing brace from the left of dcases Hit a curb today, taking a chunk out of the tire and some damage to the rim.

Secret salts; why do they slow down attacker more than they do me? What statement does it belong to? –Etan Reisner Mar 9 '15 at 17:27 1 what about the other 20 lines? –glenn jackman Mar 9 '15 at 17:27 This See my edit. A question can only have one accepted answer.

The time now is 11:23 PM. - Contact Us - UNIX & Linux - unix commands, linux commands, linux server, linux ubuntu, shell script, linux distros. - Advertising - Top for examples) as it really powerful and flexible aid in formatting the printing of your data. Gurus should pls help out #!/bin/ksh # Purpose: Check to see if file systems are filling up # Usage: Execute from crontab # Dependencies: mon_fs.dat #***************************************************** # The directory this script Help my maniacal wife decorate our christmas tree Why is the Vitamin B complex, a "complex"?

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 Share on Twitter Replace previous answer? 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 Since dash (like all other shells) is an interpreter, it won't complain until the execution reaches the problematic line.

UNIX is a registered trademark of The Open Group. Most useful knowledge from the 30's to understand current state of computers & networking? y/n; read yn; if [$yn = y]; then exit; fi; donebash: syntax error near unexpected token `done'Code: [Select]while true; do echo enough\? Hope the file for example with vim and enable the syntax check.

In it, you'll get: The week's top questions and answers Important community announcements Questions that need answers see an example newsletter By subscribing, you agree to the privacy policy and terms