Add a language to a polyglot How secure is a fingerprint sensor versus a standard password? The time now is 11:20 PM. - Contact Us - UNIX & Linux - unix commands, linux commands, linux server, linux ubuntu, shell script, linux distros. - Advertising - Top Why is the Vitamin B complex, a "complex"? Line breaks have meaning in sh scripts, but it seems you're puting them in or omitting them at random. Source
Double quote to prevent globbing and word splitting I suggest you to test your script here. Currently my script will show any files that have been created, but not necessarily completed. Last edited by Ren_kun; 08-18-2011 at 03:58 AM.. Join them; it only takes a minute: Sign up Bash Script: syntax error near unexpected token `else' up vote 1 down vote favorite I'm trying to create simple script to check
shell share|improve this question edited Jul 27 at 12:02 MJ Suriya 1,133424 asked Jul 27 at 11:57 Su_scriptingbee 62 when using functions, you don't/can't use ()s. What are the downsides to multi-classing? What are the downsides to multi-classing?
Idiomatic Expression that basically says "What's bad for you is good for me" How do I reassure myself that I am a worthy candidate for a tenure-track position, when department would Join them; it only takes a minute: Sign up Bash syntax error near unexpected token `else' up vote 0 down vote favorite I have written a simple script in bash. share|improve this answer answered Jul 27 at 12:21 Pratik Sawale 1 After removing Paranthesis, it worked fine. Syntax Error Near Unexpected Token If Search Forums Show Threads Show Posts Tag Search Advanced Search Unanswered Threads Find All Thanked Posts Go to Page... learn linux and unix commands - unix shell scripting Syntax
default override of virtual destructor Idiomatic Expression that basically says "What's bad for you is good for me" Most useful knowledge from the 30's to understand current state of computers & Syntax Error Near Unexpected Token Then' In Unix 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: There must be a space between [[ and first operator. elif [ $param=='' ]; then default() else specific() fi exit 0 Here is the error code.
Password Home Search Forums Register Forum RulesMan PagesUnix Commands Linux Commands FAQ Members Today's Posts Homework & Coursework Questions Students must use and complete the template provided. Syntax Error Near Unexpected Token Elif' Shell Script I apologize for the format, a lot of that had to do with the copy/paste process from the terminal to this page, and not the actual coding layout in UNIX. Any command of any length to be precise. I'm afraid that there's not much point in posting a completely broken snippet and asking what is wrong. –devnull Apr 26 '14 at 7:09 First learn basic about bash
Related 3bash: syntax error near unexpected token2Syntax error near unexpected token - bash3-bash: syntax error near unexpected token `)'1bash: syntax error near unexpected token `('8syntax error near unexpected token ' - Idiomatic Expression that basically says "What's bad for you is good for me" Will majority of population dismiss a video of fight between two supernatural beings? Bash Syntax Error Near Remove advertisements Sponsored Links Ren_kun View Public Profile Find all posts by Ren_kun #2 08-18-2011 zaxxon code tag tagger Join Date: Sep 2007 Last Activity: 23 November Syntax Error Near Unexpected Token Fi' Shell Script Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
asked 2 years ago viewed 4408 times active 2 years ago Related 8syntax error near unexpected token `('2syntax error near unexpected token0syntax error near unexpected token `fi'8syntax error near unexpected token this contact form Password Programming This forum is for all programming questions. Browse other questions tagged bash shell if-statement or ask your own question. An expensive jump with GCC 5.4.0 Joining two lists with relational operators How many times do you need to beat mom and Satan etc to 100% the game? Syntax Error Near Unexpected Token Then' In Shell Script
Should a country name in a country selection list be the country's local name? There is no semi-colon before the THEN statement. Why does Davy Jones not want his heart around him? http://netlookmag.com/syntax-error/syntax-error-near-unexpected-token-newline-39-bash.html Thanks a lot :) –Su_scriptingbee Jul 27 at 13:04 add a comment| 2 Answers 2 active oldest votes up vote 0 down vote When you want to call a function in
I am using cygwin in windows to do this script. 3. Syntax Error At Line Unexpected More specifically where to place the "done" or "fi" whenever I'm using a combination of both, including nesting loops. share|improve this answer answered Nov 9 '12 at 19:54 David R Tribble 6,53922144 Thank you for the feedback!
Is the script you quote in the question really exactly as the one you're executing? Remove advertisements Sponsored Links Ren_kun View Public Profile Find all posts by Ren_kun
Remnants of the dual number Is the partition function of non-conformal theories on a torus modular invariant? Because otherwise it will not be recognized as a parameter of its own. An electronics company produces devices that work properly 95% of the time How could I have modern computers without GUIs? Notices Welcome to LinuxQuestions.org, a friendly and active Linux Community.
It is a simple command. use [ "$param" == '-h' ] instead of [ $param == '-h' ] . As druuna has pointed out, all of these examples adhere to the rules mentioned. 0 members found this post helpful. How to construct a 3D 10-sided Die (Pentagonal trapezohedron) and Spin to a face?
My mistake has been found, the code has been corrected, the problem is solved. share|improve this answer answered Aug 22 '13 at 12:03 val0x00ff 3,9071824 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign The shell executes the command [ with the rest as parameters, including the ] as mandatory last parameter. if [ $unix_OS == "AIX" ] then echo "executing aix function" function_aix else echo "other function" function_other ....
Try reformatting the code, adding line breaks before the echo statements and indenting properly. A good way to provide a wrong answer first, then keep editing before someone else provides the correct answer. Is the partition function of non-conformal theories on a torus modular invariant? Word for nemesis that does not refer to a person Word that includes "food, alcoholic drinks, and non-alcoholic drinks"?
As @Etan Reisner mentioned. Do you still get error messages? The question does not have to be directly related to Linux and any language is fair game. Any help is appreciated. ./countf.sh: line 44: syntax error near unexpected token `else' ./countf.sh: line 44: `else' bash share|improve this question asked Jan 20 '15 at 21:52 Devin Baize 12 1
How to decrypt .lock files from ransomeware on Windows How many times do you need to beat mom and Satan etc to 100% the game?