Home > Syntax Error > Bash Elif Syntax Error

Bash Elif Syntax Error

Contents

Why? Visit the following links: Site Howto | Site FAQ | Sitemap | Register Now If you have any problems with the registration process or your account login, please contact us. For example: if [ $output2 = "Show" ] share|improve this answer answered Dec 1 '11 at 14:03 dogbane 136k42235322 2 LOL wow i'm stupid. –t3hcakeman Dec 1 '11 at 14:07 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... http://gatoisland.com/syntax-error/bash-if-syntax-error.php

I am programmed to greet you and give you a few options in a friendly manner. Limit involving exponentials and arctangent without L'Hôpital Problem with using pause and onslide in one frame In a GNU C macro envSet(name), what does (void) "" name mean? 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 grail View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by grail 05-10-2010, 09:03 PM #10 lucmove Member Registered: Aug 2005 Location: Brazil

Python Elif Syntax Error

Join them; it only takes a minute: Sign up Syntax error near unexpected token “elif” in bash up vote 0 down vote favorite Here's my code to display some dialogs. #!/bin/bash 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 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...

if [ $Export_Status -eq 0 ] echo "JrePath declared" elif [ $Export_Status -gt 0 ] echo "JrePath not declared" echo "export JrePath=/etc/alternatives/jre" >> /etc/profile echo "JrePath declared" fi -------------------------------------------------------------------- I am The corrected command is below. #!/bin/bash if [ -e /fms2005/Sample/CronFlag.txt ] ; then echo "data file does exist" else echo "data file does not exist" fi Top Log in or register Does mean=mode imply a symmetric distribution? Bash Syntax Error Near Unexpected Token Fi' What is your name? " name; function tehstart { echo What would you like to do today?

I tried so many variations and cannot figure out what is wrong. Syntax Error Near Unexpected Token Elif fix it with sed: sed -i 's/\r//' chkf share|improve this answer answered Nov 15 '10 at 7:13 jcomeau_ictx 22.8k44771 add a comment| up vote 0 down vote Now that you've added Search Forums Show Threads Show Posts Tag Search Advanced Search Unanswered Threads Find All Thanked Posts Go to Page... linux operating commands and unix operating commands syntax error near Still stumped.

share|improve this answer answered Oct 1 '10 at 15:03 Douglas Leeder 36.9k562109 add a comment| up vote 3 down vote You need semicolons before the keyword then . # shell script Bash Syntax Error Invalid Arithmetic Operator Registration is quick, simple and absolutely free. How to handle spending money for extended trip to Europe? druuna View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by druuna View Blog 05-10-2010, 02:23 PM #8 lucmove Member Registered: Aug 2005

Syntax Error Near Unexpected Token Elif

joshuaduan Shell Programming and Scripting 8 05-14-2007 09:02 AM syntax error at line 33: `elif` unexpected hazy UNIX for Dummies Questions & Answers 4 02-09-2006 01:51 PM All times are GMT 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 Python Elif Syntax Error Why can a Gnome grapple a Goliath? Bash Syntax Error Near Unexpected Token Done' Natural construction Can a creature benefit from differently typed speed bonuses all named fast movement?

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 http://gatoisland.com/syntax-error/bash-for-loop-syntax-error.php Should indoor ripened tomatoes be used for sauce? 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 For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. Bash Syntax Error Near Unexpected Token Else'

Intuition behind Harmonic Analysis in Analytic Number Theory Meaning of "soul-sapping" A simple visual puzzle to die for I accepted a counter offer and regret it: can I go back and What is your name? " name; function tehstart { echo What would you like to do today? User contributions on this site are licensed under the Creative Commons Attribution Share Alike 4.0 International License. http://gatoisland.com/syntax-error/bash-for-syntax-error.php Index Nav: [DateIndex] [SubjectIndex] [AuthorIndex] [ThreadIndex] Message Nav: [DatePrev][DateNext] [ThreadPrev][ThreadNext] RE: "if" "then" "elif" "fi" "done" To: Subject: RE: "if" "then" "elif" "fi" "done" From: "Fritz,

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 Then' 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... options2 = "Current Different Back" select choice2 in $options2; do if [ "$choice2" = "Current" ]; then echo Ok, the files in this directory are...

How to make different social classes look quite different?

The Woz Monitor How to map and sum a list fast? Can Customs make me go back to return my electronic equipment or is it a scam? Thanks to all. Bash Syntax Error Near Unexpected Token Do' Force Microsoft Word to NEVER auto-capitalize the name of my company more hot questions question feed lang-sh about us tour help blog chat data legal privacy policy work here advertising info

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 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 Print This Log in or register to post comments Like (0 likes) 2 Comments Comments RecommendedDate October 8, 2010 #2 mfillpot You don't need the double brackets and you don't need his comment is here If not, why?

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 Contact Us - Advertising Info - Rules - LQ Merchandise - Donations - Contributing Member - LQ Sitemap - Main Menu Linux Forum Android Forum Chrome OS Forum Search LQ How is my code any different from these examples or these examples? 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

When was this language released? Should indoor ripened tomatoes be used for sauce? LinuxQuestions.org > Forums > Non-*NIX Forums > Programming [SOLVED] bash: syntax error near unexpected token `else' User Name Remember Me? I accepted a counter offer and regret it: can I go back and contact the previous company?

bash unix if-statement share|improve this question asked Dec 1 '11 at 14:01 t3hcakeman 57631223 add a comment| 3 Answers 3 active oldest votes up vote 4 down vote accepted You need Im connecting to our Solaris Server through xShell... do you get an error? Join them; it only takes a minute: Sign up How can I fix shell error “syntax error near unexpected token 'elif'” up vote 1 down vote favorite I have this run

Why? This file format (ff) set command tells vi to use LF-only line endings when the file is saved.

© Copyright 2017 gatoisland.com. All rights reserved.