Home > Syntax Error > Syntax Error Near Unexpected Token Fi' Mac

Syntax Error Near Unexpected Token Fi' Mac

Contents

Outlet w/3 neutrals, 3 hots, 1 ground? How to change 'Welcome Page' on the basis of logged in user or group? What does "put on one's hat" mean? Why would Snape set his office password to 'Dumbledore'? Source

Join them; it only takes a minute: Sign up shell : syntax error near unexpected token `fi' up vote 0 down vote favorite Getting syntax error near unexpected token `fi' while Hope this helps. This site is not affiliated with Linus Torvalds or The Open Group in any way. Essentially, your problem is the unbalanced quotes.

Syntax Error Near Unexpected Token Fi' Mac

This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. That's why you're getting the weird error output, because the CR is moving the cursor to the start of the line before continuing the message, overwriting some of what it's already UNIX is a registered trademark of The Open Group. How do I politely decline a research grant?

Browse other questions tagged shell-script or ask your own question. The shell will interpret than as part of test-commands, but then it finds a fi statement, which is incorrect (and, yes, unexpected) because it never encountered the then part. Every pair of single and double quotes must be balanced, meaning, whenever you have an opening quote, you have to have a closing quote later on in the same statement, and Syntax Error Near Unexpected Token `then' Is there any financial benefit to being paid bi-weekly over monthly?

Are you new to LinuxQuestions.org? printfs first argument is the format string (in this case, "su"), hence, it will print su. Feynman diagram and uncertainty Am I being a "mean" instructor, denying an extension on a take home exam Remnants of the dual number Unable to complete a task at work. is kinda special and escaping it (\!) will probably not work.

Plus and Times, Ones and Nines Understanding the grammar: «illis Evangelii nuntiandi praebens mandatum» Lagrange multiplier on unit sphere Why is the Vitamin B complex, a "complex"? Syntax Error Near Unexpected Token Else thx!!! else .. Browse other questions tagged bash or ask your own question.

Syntax Error Near Unexpected Token Fi' Cygwin

Syntactically, then should go to a separate line. e.g:- 062000002015.00"; echo "Example: sh run_billing.sh 062000002015.00"; exit 1 fi if [ $NARGS -eq 2 ] then echo "Run Billing script - pin_bill_day"; pin_virtual_time -m2 $1; pin_bill_day; fi shell scripting share|improve Syntax Error Near Unexpected Token Fi' Mac 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 Syntax Error Near Unexpected Token Fi Linux Why are terminal consoles still used?

the sum of consecutive odd numbers Add a language to a polyglot TV episode or movie where people on planet only live a hundred days and fall asleep at prescribed time this contact form Advertisement Training See all LFS465 Software Defined Networking with OpenDaylight December 12, 2016 Learn more LFS301 Linux System Administration December 12, 2016 Learn more LFD435 Developing Embedded Linux Device Drivers December share|improve this answer answered May 9 '12 at 19:52 Bram 1,02159 Thank so much guys! working now. Syntax Error Near Unexpected Token For

check that your code has Unix line endings (\n) not windows/dos line endings \r\n as the \r is interpeted as an unexpected token. I picked bash out of a hat as the question didn't specify. I corrected this problem, too. –peterh Dec 14 '13 at 18:46 Still has many errors. –Aleks-Daniel Jakimenko-A. have a peek here So why restrict the script to bash when it will run with either?

it takes forever to type... Syntax Error Near Unexpected Token Elif' Shell Script Using single quotes should help. Plus and Times, Ones and Nines How to reward good players, in order to teach other players by example Am I being a "mean" instructor, denying an extension on a take

Is there any financial benefit to being paid bi-weekly over monthly?

Notices Welcome to LinuxQuestions.org, a friendly and active Linux Community. function definition while read -p "What file editor would you like to use? (Nano) or (Vi)m " answer do answer=$(echo "$answer" | tr '[:upper:]' '[:lower:]') case $answer in ( nano | Why do the Avengers have bad radio discipline? Syntax Error Near Unexpected Token `done' sleep 1 editor() Is there anything I'm missing?

Can a free radical be created by chemical reaction of non-radical species? What mechanical effects would the common cold have? The parser for bash is complaining about a missing ';' after the (), but that's only part of the problem. Check This Out Removing brace from the left of dcases Why do the Avengers have bad radio discipline?

Square root image filter tool in Python Binary to decimal converter Change syntax of macro, to go inside braces Help my maniacal wife decorate our christmas tree How to properly localize