Syntax Error Near Unexpected Token 'else'
Browse other questions tagged shell or ask your own question. 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 ;. Also thanks for the link. –GleDel Apr 24 '15 at 10:17 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign current community chat Unix & Linux Unix & Linux Meta your communities Sign up or log in to customize your list. his comment is here
Just pass any args needed, i.e. what's the error? –qqibrow Jan 20 '15 at 22:15 sorry new to stack overflow and learning formatting, i edited my comment above –Devin Baize Jan 20 '15 at 22:16 The problem statement, all variables and given/known data: line 37: syntax error near unexpected token 'else' line 37: ' else' the script is made to take 1 or 2 command line Please Try > again!" fi done unix if-statement nested syntax-error nested-loops share|improve this question asked Nov 9 '12 at 16:26 user1801053 92 2 That's really awful code formatting.
Bash Syntax Error Near
if [ $unix_OS == "AIX" ] then echo "executing aix function" function_aix else echo "other function" function_other .... When I run the below block of code if [ $rc -eq 0 ] then passed=`tr ' ' '\n' < $TFILE | grep -c PASSED` error=`tr ' ' '\n' < $TFILE LinuxQuestions.org > Forums > Non-*NIX Forums > Programming [SOLVED] bash: syntax error near unexpected token `else' User Name Remember Me?
Why is bench pressing your bodyweight harder than doing a pushup? lucmove View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by lucmove 05-10-2010, 04:34 AM #2 druuna LQ Veteran Registered: Sep 2003 Posts: The Following User Says Thank You to zaxxon For This Useful Post: Ren_kun(08-19-2011) Remove advertisements Sponsored Links zaxxon View Public Profile Find all posts by zaxxon #5 08-18-2011 Ren_kun Syntax Error Near Unexpected Token If Not the answer you're looking for?
Browse other questions tagged bash shell if-statement or ask your own question. Syntax Error Near Unexpected Token Then' In Unix Thanks in advance. 2. how to find it in future Below is the error ./test.sh: line 5: syntax error near unexpected token `else' ./test.sh: line 5: `else' below is my PATH /u01/app/oracle/product/10.2.0/db_1/bin:/usr/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/oracle/bin which bash /bin/bash like [ $param == '-h' ]; you need to double quote your variable.
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 Syntax Error Near Unexpected Token Elif' Shell Script Change syntax of macro, to go inside braces Plus and Times, Ones and Nines Is the partition function of non-conformal theories on a torus modular invariant? If you do not put a space after [ the shell will try to execute [whatever as command and fail. Insearch: (University of Technology Sydney), Sydney NSW, Australia, James Hu (web systems), www(dot)insearch.edu.au/default.aspx?ArticleID=430 Note: Without school/professor/course information, you will be banned if you post here!
Syntax Error Near Unexpected Token Then' In Unix
Why is the Vitamin B complex, a "complex"? How can I stun or hold the whole party? Bash Syntax Error Near Remove advertisements Sponsored Links Ren_kun View Public Profile Find all posts by Ren_kun