Home > Syntax Error > Syntax Error Near Unexpected Token Fi

Syntax Error Near Unexpected Token Fi

Contents

What you should prefer in bash is [[ ]]. Join them; it only takes a minute: Sign up syntax error near unexpected token `fi' while checking no of arguments passed up vote 2 down vote favorite I am new to If you need to reset your password, click here. share|improve this answer edited Mar 20 at 19:38 answered Mar 20 at 18:26 Archemar 12.7k82149 I didn't even get to $editor "file name" –Scripty Coder Mar 20 at 19:16 navigate here

Can a creature with 0 power attack? So why restrict the script to bash when it will run with either? I runned it online on http://www.compileonline.com/execute_bash_online.php it is working well but not on my system(Centos 6.2). Join them; it only takes a minute: Sign up shell : syntax error near unexpected token `fi' up vote 0 down vote favorite Getting syntax error near unexpected token `fi' while

Syntax Error Near Unexpected Token Fi' Mac

So I guess I will case-esac it. –Scripty Coder Mar 20 at 19:14 I only needed to change '[:upper:]' '[:lower:]' to '[A-Z]' '[a-z]' –Scripty Coder Mar 20 at 19:26 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 asked 6 years ago viewed 5152 times active 5 years ago Related 0Redhat Shell Script If Statement fails with odd syntax error-1Please help me understand useradd example's syntax0Apache print syntax errors But there is another problem, $(( … )) tries to execute "fname % 2", and this is not what you want.

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in. the sum of consecutive odd numbers Should a country name in a country selection list be the country's local name? crossley View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by crossley Thread Tools Show Printable Version Email this Page Search this Thread Advanced Syntax Error Near Unexpected Token `then' That should solve this problem.

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 Fi' Cygwin The second is equivalent to your if statement. druuna View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by druuna View Blog 04-18-2007, 06:00 AM #3 sureshkumar.repaka LQ Newbie Registered: Apr 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

Difficulties interpreting this complex sentence Is an internal HDD with Ubuntu automatically bootable from an external USB case? Syntax Error Near Unexpected Token Else LinuxQuestions.org > Forums > Linux Forums > Linux - General syntax error near unexpected token `fi' User Name Remember Me? printf ... by default for a noninteractive script (eg cron driven), which usually ends up in a script that was written with bash specific features to almost work in the most confusing way.

Syntax Error Near Unexpected Token Fi' Cygwin

Is it still safe to drive? So I am between giving this answer -1 or nothing at all... –Aleks-Daniel Jakimenko-A. Syntax Error Near Unexpected Token Fi' Mac Might want to change it to something else... –Wouter Verhelst Dec 15 '15 at 7:36 add a comment| 1 Answer 1 active oldest votes up vote 6 down vote Unbalanced quotes Syntax Error Near Unexpected Token Fi Linux the sum of consecutive odd numbers Add a language to a polyglot TV episode or movie where people on planet only live a hundred days and fall asleep at prescribed time

below is the output:- : command not founde 2: : command not founde 7: run_billing.sh: line 22: syntax error near unexpected token `fi' 'un_billing.sh: line 22: `fi The script is: #!/bin/sh check over here asked 4 years ago viewed 2904 times active 4 years ago Related 0Redhat Shell Script If Statement fails with odd syntax error0Syntax error near unexpected token 'fi'4Bash script error: ./test: line Browse other questions tagged bash or ask your own question. Lagrange multiplier on unit sphere What mechanical effects would the common cold have? Syntax Error Near Unexpected Token For

For example, lines 2 and 7 of your script (the supposedly blank lines) contain a single CR character which is interpreted as a command which doesn't exist. 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, some linux systems will use busybox, dash, ash... http://allconverter.net/syntax-error/syntax-error-near-unexpected-token-in.html I just realized that my encoding in Notepad++ had somehow gotten changed to "Windows/Dos" instead of "UNIX".

druuna View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by druuna View Blog 04-18-2007, 06:37 AM #5 sureshkumar.repaka LQ Newbie Registered: Apr Syntax Error Near Unexpected Token Elif' Shell Script Unix & Linux Stack Exchange works best with JavaScript enabled current community blog chat Server Fault Meta Server Fault your communities Sign up or log in to customize your list. How to construct a 3D 10-sided Die (Pentagonal trapezohedron) and Spin to a face?

Not the answer you're looking for?

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 Not the answer you're looking for? A pilot's messages How secure is a fingerprint sensor versus a standard password? Syntax Error Near Unexpected Token `done' is kinda special and escaping it (\!) will probably not work.

Deep theorem with trivial proof Why does Snoke not cover his face? This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. How many times do you need to beat mom and Satan etc to 100% the game? weblink fi construct.

It works on my machine. e.g:- 062000002015.00"; echo "Example: sh run_billing.sh 062000002015.00"; exit 1 fi if [ $NARGS -eq 2 ] then echo "Run Billing script - pin_bill_day"; pin_virtual_time -m2 $1; pin_bill_day; fi shell scripting share|improve value is returned in EDITOR export $answer= is likely to fail (first time) or give unexpected result (next time) use $answer to call editor ( or $answer "$myfile" ), use export What are the ground and flight requirements for high performance endorsement?

It should tell you that [ is an alias to test command, so [ ] in bash is not some special syntax for conditionals, it is just a command on its test $? = 0; then or if [ $? -ne 0 ];then or test $? = 0 || echo 'error'; or even better: rm /bla/bla || echo 'error'; (the last one Are you new to LinuxQuestions.org? in your string. !

asked 5 years ago viewed 19323 times active 5 years ago Related 0Bash script throws “syntax error near unexpected token `}'” when run0Why syntax error near unexpected token `fi' is coming5bash: What does "put on one's hat" mean? Feynman diagram and uncertainty Am I being a "mean" instructor, denying an extension on a take home exam Remnants of the dual number Unable to complete a task at work. Re-wrote the code in a vi editor rather than notepad. –Bharti Mar 24 '15 at 9:28 'Did not work' is not that helpful, but you probably should be using

UNIX is a registered trademark of The Open Group. Hot Network Questions An expensive jump with GCC 5.4.0 Add a language to a polyglot Why does MIT have a /8 IPv4 block? Why are terminal consoles still used? Binary to decimal converter An expensive jump with GCC 5.4.0 Am I being a "mean" instructor, denying an extension on a take home exam Why is bench pressing your bodyweight harder

Bounce off the atmosphere at reentry?