Home > Syntax Error > Syntax Error Near Unexpected Token Elif' Bash

Syntax Error Near Unexpected Token Elif' Bash

Contents

Code: sh ./SkyFireDB/linux_installer.sh ./SkyFireDB/linux_installer.sh: line 67: syntax error near unexpected token `done' ./SkyFireDB/linux_installer.sh: line 67: ` done' before it was: Code: sh ./SkyFireDB/linux_installer.sh ./SkyFireDB/linux_installer.sh: line 44: logo: command not found i The reason for space before the ] is similar. Aligning texts side by side with equations in \align environment Amplifier circuit woe How to construct a 3D 10-sided Die (Pentagonal trapezohedron) and Spin to a face? Use http://mywiki.wooledge.org/BashGuide instead. 1 members found this post helpful. http://netlookmag.com/syntax-error/syntax-error-near-unexpected-token-elif-39-in-linux.html

Either use your text editor to save the file without carriage returns or run the script through dos2unix (or perhaps d2u) share|improve this answer answered Sep 11 '13 at 13:08 glenn They do not always work the same: Code: $ cat foobar #!/bin/bash for i in $(ls -1a); do if [ "$i" == '.' ] then echo 'one dot' elif [ "$i" options = "ListFiles Make/EditFile Quit" select choice in $options; do if [ "$choice" = "ListFiles" ]; then echo Would you like to list the files of the current directory, or a By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features.

Syntax Error Near Unexpected Token Elif' Bash

Why is the Vitamin B complex, a "complex"? colucix View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by colucix 05-10-2010, 01:04 PM #7 druuna LQ Veteran Registered: Sep 2003 Posts: Can you please rephrase? –Jens May 8 '12 at 14:04 add a comment| up vote 4 down vote The then statement needs to be on a new line, or separate from current community chat Stack Overflow Meta Stack Overflow your communities Sign up or log in to customize your list.

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in. Is it unethical to take a photograph of my question sheets from a sit-down exam I've just finished if I am not allowed to take them home? But that's a different question than asked. –Thomas Dickey Aug 20 at 21:05 Yes, that's another error, but not the one causing the messages in the question because the Syntax Error Near Unexpected Token `elif' In Unix This site is not affiliated with Linus Torvalds or The Open Group in any way.

The shell executes the command [ with the rest as parameters, including the ] as mandatory last parameter. Syntax Error Near Unexpected Token Fi' Shell Script 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 For the shell to recognize the then as a token it needs to standing in a line on its own or be separated by a ;. 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

Last edited by Deadlyhugs; November 6th, 2011 at 08:25 PM. Syntax Error Near Unexpected Token Else In Shell Script if [ -f "$PROJECT_DIR/build/Release-macosx/UnicodeEscape" ] ; then build/Release-macosx/UnicodeEscape "en.lproj/Localizable.strings" ; elif [ -f "$PROJECT_DIR/build/Debug-macosx/UnicodeEscape" ] ; then build/Debug-macosx/UnicodeEscape "en.lproj/Localizable.strings" ; fi share|improve this answer edited Oct 1 '10 at 15:08 answered I also searched this forum. split strings and add them as new row Display a Digital Clock Why would a NES game use an undocumented 1-byte or 2-byte NOP in production?

Syntax Error Near Unexpected Token Fi' Shell Script

joshuaduan Shell Programming and Scripting 8 05-14-2007 10:02 AM syntax error at line 33: `elif` unexpected hazy UNIX for Dummies Questions & Answers 4 02-09-2006 02:51 PM All times are GMT Deep theorem with trivial proof Rebus: Guess this movie Why does Snoke not cover his face? Syntax Error Near Unexpected Token Elif' Bash the sum of consecutive odd numbers Why is bench pressing your bodyweight harder than doing a pushup? Syntax Error Near Unexpected Token Elif' In Linux Any other ideas?

For details and our forum data attribution, retention and privacy policy, see here FAQ Forum Quick Links Unanswered Posts New Posts View Forum Leaders FAQ Contact an Admin Forum Community Forum http://netlookmag.com/syntax-error/syntax-error-near-unexpected-token-newline-39-bash.html Square root image filter tool in Python Removing brace from the left of dcases Aligning texts side by side with equations in \align environment What are the ground and flight requirements Not the answer you're looking for? Browse other questions tagged bash or ask your own question. Syntax Error Near Unexpected Token Fi Mac

VT-x is not available, but is enabled in BIOS Resubmitting elsewhere without any key change when a paper is rejected TV episode or movie where people on planet only live a Join them; it only takes a minute: Sign up Syntax error near unexpected token 'fi' up vote 21 down vote favorite 2 I'm trying to write a script that removes all options = "ListFiles Make/EditFile Quit" select choice in $options; do if [ "$choice" = "ListFiles" ]; then echo Would you like to list the files of the current directory, or a have a peek here Join them; it only takes a minute: Sign up Syntax error near unexpected token 'elif' up vote 2 down vote favorite #!/bin/bash if [ "$1" = "boot" ] then if [

I know we are missing something, just trying to figure out what that something is. Syntax Error Elif Unexpected Expecting Then This may or may not explain the problem. In fact, it was "spot on".

When I create a script then manually add the CR characters, I get exactly the same error: qq.sh: line 3: syntax error near unexpected token `elif' 'q.sh: line 3: `elif [

Are there too few Supernova Remnants to support the Milky Way being billions of years old? Why is bench pressing your bodyweight harder than doing a pushup? I disagree with you. If Elif Bash Aligning texts side by side with equations in \align environment Positivity of certain Fourier transform default override of virtual destructor Word that includes "food, alcoholic drinks, and non-alcoholic drinks"?

This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. This $'' syntax is explained here To make it completely perfect you should place -- before arbitrary filenames, otherwise rm might treat it as a parameter if the file name starts This is my code: #!/bin/bash echo "start\n" for f in *.jpg do fname=$(basename "$f") echo "fname is $fname\n" fname="${filename%.*}" echo "fname is $fname\n" if[$((fname % 2)) -eq 1 ] then echo http://netlookmag.com/syntax-error/syntax-error-near-unexpected-token-bash-function.html ls elif [ "$choice2" = "Different" ]; then read -p "Ok, which directory do you want to list the files of? " directory; echo Ok, the files in $directory are...

Yes, I googled. Code: sh ./SkyFireDB/linux_installer.sh ./SkyFireDB/linux_installer.sh: line 67: syntax error near unexpected token `done' ./SkyFireDB/linux_installer.sh: line 67: ` done' before it was: Code: sh ./SkyFireDB/linux_installer.sh ./SkyFireDB/linux_installer.sh: line 44: logo: command not found i Join Date May 2008 Beans 77 Re: Bash - syntax error near unexpected token `elif' Originally Posted by Squigy Dunkens i am learning bash, and i made this program just for to Code: echo -e "\!Not an Option\!" |>[HowTo] Bump The BUMP Thread<||>Stats<||>19k<||>23k<||>26k<||>34k<||>37k<||>38k<||>39k<||>40k<| Originally Posted by lukjad007 Backups are usually a good thing unless it's a sewer.

measurable linear functionals are also continuous on separable Banach spaces? Password Programming This forum is for all programming questions. Ubuntu Logo, Ubuntu and Canonical Canonical Ltd.