Home > Syntax Error > Bash Elif Syntax Error

Bash Elif Syntax Error

Contents

ls elif [ "$choice2" = "Back" ]; then tehstart else echo Sorry, Thats not an option fi done elif [ "$choice" = "Make/EditFile" ] read -p "What should the file name HITTING HEAD ON A WALL!!!... Thanks to all. But something is up with the ELSE statement: Code: luc$[519]test> for i in $(ls -1a); do > if[ "$i" == '.' ] then > echo 'one dot' > elif[ "$i" == http://onlinetvsoftware.net/syntax-error/bash-for-syntax-error.php

Unexpected parent process id in output What to tell to a rejected candidate? 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 SOLVED! Modern soldiers carry axes instead of combat knives.

Python Elif Syntax Error

My favorite command for this: most -b script.sh –hyde Sep 11 '13 at 13:12 add a comment| 2 Answers 2 active oldest votes up vote 6 down vote The garbled error echo $BASH_VERSION –outis Nov 15 '10 at 7:06 3.2.0(1)-release –Strawberry Nov 15 '10 at 7:07 Works fine for me with 4.1.5(1)-release, might be something in your old Unix & Linux Stack Exchange works best with JavaScript enabled FAQ Forum Quick Links Unanswered Posts New Posts View Forum Leaders FAQ Contact an Admin Forum Community Forum Council FC Agenda you can use Code: set -x in your script to help in debugging.

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 THINKING!!!... There is no semi-colon before the THEN statement. Bash Syntax Error Near Unexpected Token Fi' Python tutorial |Unix power tools|Effective AWK|A handful of Awk|Perl|File Renamer|Bash ref Adv Reply March 6th, 2009 #5 Squigy Dunkens View Profile View Forum Posts Private Message 5 Cups of Ubuntu

Page 1 of 2 12 Last Jump to page: Results 1 to 10 of 13 Thread: Bash - syntax error near unexpected token `elif' Thread Tools Show Printable Version Subscribe to Are there any 'smart' ejection seats? share|improve this answer answered Mar 7 '14 at 17:00 konyak 3,03512441 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign druuna View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by druuna View Blog 05-10-2010, 04:07 AM #3 grail LQ Guru Registered: Sep

Good way to explain fundamental theorem of arithmetic? Bash Syntax Error Invalid Arithmetic Operator My mistake has been found, the code has been corrected, the problem is solved. fi done elif [ "$choice" = "Make/EditFile" ];then read -p "What should the file name be, or if your editing a file, what is the file name" filename; vim $filename elif 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...

Syntax Error Near Unexpected Token Elif

To put if and then on the same line you have to separate them with semi-colon, that is the same you did with for and do in the first line. 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 Python Elif Syntax Error This happened because I was working from Windows. Bash Syntax Error Near Unexpected Token Done' what is the difference between \twocolumn and \documentclass[twocolumn]{book} Is the standard Canon 18-55 lens the same as 5 years ago?

Ubuntu Ubuntu Insights Planet Ubuntu Activity Page Please read before SSO login Advanced Search Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Bash - syntax error this content How to make different social classes look quite different? That's because this is not a cygwin specific problem. Quote: When if and then are on same line in a condition test, a semicolon must terminate the if statement. Bash Syntax Error Near Unexpected Token Else'

As druuna has pointed out, all of these examples adhere to the rules mentioned. 0 members found this post helpful. Is the standard Canon 18-55 lens the same as 5 years ago? What are the canonical white spaces? http://onlinetvsoftware.net/syntax-error/bash-if-syntax-error.php Password Home Search Forums Register Forum RulesMan PagesUnix Commands Linux Commands FAQ Members Today's Posts Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK

thinking!... Bash Syntax Error Near Unexpected Token Then' Aug 20 at 23:10 This question has been asked before and already has an answer. 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

Python tutorial |Unix power tools|Effective AWK|A handful of Awk|Perl|File Renamer|Bash ref Adv Reply March 6th, 2009 #3 Squigy Dunkens View Profile View Forum Posts Private Message 5 Cups of Ubuntu

tuxdev View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by tuxdev 05-10-2010, 11:47 AM #5 lucmove Member Registered: Aug 2005 Location: Brazil no outgoing connection via ipv4 Problem with using pause and onslide in one frame Does mean=mode imply a symmetric distribution? Adv Reply March 6th, 2009 #6 Squigy Dunkens View Profile View Forum Posts Private Message 5 Cups of Ubuntu Join Date Mar 2009 Beans 27 Re: Bash - syntax error Bash Syntax Error Near Unexpected Token Do' Is the empty set homeomorphic to itself?

If you need to reset your password, click here. Should indoor ripened tomatoes be used for sauce? Can Customs make me go back to return my electronic equipment or is it a scam? http://onlinetvsoftware.net/syntax-error/bash-expr-syntax-error.php Now I know my ABCs, won't you come and golf with me?

Browse other questions tagged bash or ask your own question. Do COB LEDs usually need electrically insulating from the heatsink? Use http://mywiki.wooledge.org/BashGuide instead. 1 members found this post helpful. Code: if [ "$i" == '.' ] then echo 'one dot' fi If so, I would like to write to the authors of such pages as - http://tldp.org/LDP/abs/html/testconstructs.html And ask them

Does mean=mode imply a symmetric distribution? Natural construction Can a creature benefit from differently typed speed bonuses all named fast movement? 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... dos2unix is a handy utility installed on many systems, removes the CRs inplace. –Tony D Nov 15 '10 at 8:39 2 If you are using vim as editor, you can

The problem was I had used tab instead of space before the brackets. Should indoor ripened tomatoes be used for sauce?