waspsoft.com


Home > Syntax Error > Bash Elif Syntax Error

Bash Elif Syntax Error

Contents

share|improve this answer edited Nov 15 '10 at 7:20 answered Nov 15 '10 at 7:15 paxdiablo 488k1179691416 +1, Nice approach. –codaddict Nov 15 '10 at 7:16 2 Nice Edit: When I add #!/bin/bash at the top, I get the following error: interpreter "/bin/bash" not found file link resolves to "/usr/bin/bash" -bash: ./chkf: /bin/bash^M: bad interpreter: No such file or 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. 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 this contact form

Still stumped. If those answers do not fully address your question, please ask a new question. 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 no outgoing connection via ipv4 Problem with using pause and onslide in one frame Does mean=mode imply a symmetric distribution?

Python Elif Syntax Error

If not, why? Forum Operations by The UNIX and Linux Forums Register a domain and help support LQ Blogs Recent Entries Best Entries Best Blogs Blog List Search Blogs Home Forums HCL Reviews Tutorials asked 3 years ago viewed 2478 times active 2 years ago Visit Chat Linked 6 \n and \r seem to work everywhere. It should be: if [ "$i" == '.' ] then or if [ "$i" == '.' ]; then Hope this helps.

Realism of a setting with several sapient anthropomorphic animal species Can I use an HSA as investment vehicle by overcontributing temporarily? Learn More © 2016 The Linux Foundation This is the mail archive of the [email protected] mailing list for the Cygwin project. For example, the first if statement should be: if [ "$output" = "Hidden Files" ] -- otherwise if $output is Hidden Files, the test command will see that as two strings Bash Syntax Error Near Unexpected Token Fi' 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

what is the difference between \twocolumn and \documentclass[twocolumn]{book} Is the standard Canon 18-55 lens the same as 5 years ago? Syntax Error Near Unexpected Token Elif THINKING!!!... This happened because I was working from Windows. Thanks > > Pete Harter > ITT A/CD Mechanical Analysis > 219-451-6865 > > > > -- > Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple > Bug reporting: http://cygwin.com/bugs.html > Documentation: http://cygwin.com/docs.html > FAQ:

A simple visual puzzle to die for Is it possible to check for existence of member template just by identifier? Bash Syntax Error Invalid Arithmetic Operator i still get the same error but it says line 30 instead of 27 Adv Reply March 6th, 2009 #8 nunki View Profile View Forum Posts Private Message Just Give Rather than fragments, please post a minimal test case. –outis Nov 15 '10 at 7:04 @outis I am using bash –Strawberry Nov 15 '10 at 7:05 What Both if and then are keywords.

Syntax Error Near Unexpected Token Elif

I accepted a counter offer and regret it: can I go back and contact the previous company? That's because this is not a cygwin specific problem. Python Elif Syntax Error lucmove View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by lucmove 05-10-2010, 03:34 AM #2 druuna LQ Veteran Registered: Sep 2003 Posts: Bash Syntax Error Near Unexpected Token Done' Not the answer you're looking for?

HITTING HEAD ON A WALL!!!... weblink Thanks to all. Is the empty set homeomorphic to itself? options2 = "Current Different Back" select choice2 in $options2; do if [ "$choice2" = "Current" ]; then echo Ok, the files in this directory are... Bash Syntax Error Near Unexpected Token Else'

Contact Us - Advertising Info - Rules - LQ Merchandise - Donations - Contributing Member - LQ Sitemap - Main Menu Linux Forum Android Forum Chrome OS Forum Search LQ 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 Skeletal formula for carbon with two double bonds What to tell to a rejected candidate? navigate here Having a problem logging in?

Why? Bash Syntax Error Near Unexpected Token Then' you can use Code: set -x in your script to help in debugging. ShellCheck is your friend. –Kusalananda Aug 20 at 21:05 When you edit shell scripts under Windows, make sure to use Unix line endings. –Gilles Aug 20 at 23:13 add

User contributions on this site are licensed under the Creative Commons Attribution Share Alike 4.0 International License.

Quote your expansions. 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 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 Do' 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

Yes, of course I'm an adult! options2 = "Current Different Back" select choice2 in $options2; do if [ "$choice2" = "Current" ]; then echo Ok, the files in this directory are... Which requires more energy: walking 1 km or cycling 1 km at the same speed? his comment is here Look: Code: luc$[518]test> for i in $(ls -1a); do > if[ "$i" == '.' ]; then bash: syntax error near unexpected token `then' The correct way is without the semi-colon.

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. It should be output3, not output2. It should be: if [ "$i" == '.' ] then or if [ "$i" == '.' ]; then Hope this helps. 1 members found this post helpful. Modern soldiers carry axes instead of combat knives.

systool.sh: line 14: [: =: unary operator expected –t3hcakeman Dec 1 '11 at 15:19 The if-statement under "Desktop" is referring to the wrong variable. Are you new to LinuxQuestions.org? 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 They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

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 This should work: Code: $ for i in $(ls -1a); do > if [ "$i" == '.' ]; then echo 'one dot' > elif [ "$i" == '..' ]; then echo Find all posts by dr.house

#3 09-19-2009 proactiveaditya Registered User Join Date: Sep 2009 Last Activity: 17 March 2016, 11:33 AM EDT Location: Kolkata,India Posts: Keywords (or commands) begin statements, and before a new statement on the same line begins, the old one must terminate. 0 members found this post helpful.

Can Customs make me go back to return my electronic equipment or is it a scam? Should indoor ripened tomatoes be used for sauce? 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 fi do a "man test" to find the differences between "-gt" and ">" etc.

If you'd like to contribute content, let us know.