Home > Syntax Error > Syntax Error Unexpected End Of File Bash

Syntax Error Unexpected End Of File Bash

Contents

Ordering a bulky item in the USA Binary to decimal converter Need a way for Earth not to detect an extrasolar civilization that has radio What does "put on one's hat" You will sometimes want to set a variable's value to nothing. A number cannot be at the same time less than 0 and greater than 12, so your second condition can never be true. A pilot's messages How many times do you need to beat mom and Satan etc to 100% the game? his comment is here

Please enter you password now:" b if [ "$b" = "12345678" ] then echo "You really are Emma!! share|improve this answer answered Aug 23 at 19:49 Rafael Urena 161 This was exactly my case. To do this, create the following script called trouble.bash. In line 5, the shell substitutes the value of number where it sees $number.

Syntax Error Unexpected End Of File Shell Script

Should a country name in a country selection list be the country's local name? Sorry. Most useful knowledge from the 30's to understand current state of computers & networking? Here are a couple of techniques that you will find useful: Isolate blocks of code by "commenting them out." This trick involves putting comment characters at the beginning of lines of

You can install dos2unix in ubuntu with this: sudo apt-get install dos2unix share|improve this answer answered Jun 16 '11 at 2:50 clyfish 5,08111822 thanks guys! Code: PS3="Exit this loop [choose 1 or 2]? " select answer in Yes No; do case $answer in Yes) echo "Ok, exiting now. A simple it didn't work for me suffices. Syntax Error Unexpected End Of Input Why do the Avengers have bad radio discipline?

You probably think that by removing the "1" on line 3 it created a syntax error on line 3, but it didn't. Syntax Error, Unexpected End Of File Php Join our community today! Ask Ubuntu works best with JavaScript enabled UbuntuCommunityAsk!DeveloperDesignDiscourseHardwareInsightsJujuShopMore ›AppsHelpForumLaunchpadMAASCanonical current community chat Ask Ubuntu Ask Ubuntu Meta your communities Sign up or log in to customize your list. nc -z $Host $Port; then (or nc -z $Host $Port; result_nc=$?

Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the Syntax Error Near Unexpected Token `fi' thanks –markcruz Jun 16 '11 at 2:54 thanks! How can I stun or hold the whole party? Code: if [[ $answer1 == "N" || $answer1 == "n" ]]; then ## incorrect if [[ $answer1 == "N" || $answer1 == "n" ]]; then ## correct But anyway, case statements

Syntax Error, Unexpected End Of File Php

What happens is the shell keeps looking for the closing quotation mark to tell it where the end of the string is, but runs into the end of the file before smecnb View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by smecnb 12-30-2011, 01:06 PM #10 T3RM1NVT0R Senior Member Registered: Dec 2010 Location: Syntax Error Unexpected End Of File Shell Script Isolating problems Finding bugs in your programs can sometimes be very difficult and frustrating. Bash Unexpected End Of File While Looking For Matching 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

Rebus: Guess this movie An electronics company produces devices that work properly 95% of the time Unable to complete a task at work. this content Remnants of the dual number Resubmitting elsewhere without any key change when a paper is rejected more hot questions question feed lang-sh about us tour help blog chat data legal privacy Help my maniacal wife decorate our christmas tree Why do the Avengers have bad radio discipline? Just starting out and have a question? Syntax Error Unexpected End Of File In Unix

What is this strange biplane jet aircraft with tanks between wings? As it's currently written, it’s hard to tell exactly what you're asking. fixed a coupla errors 4 members found this post helpful. http://allconverter.net/syntax-error/syntax-error-near-unexpected-token-bash.html also, what system are you running? (Linux, MacOS, BSD, distro, etc) –aaronstacy Jun 16 '11 at 2:47 add a comment| up vote 1 down vote So I found this post and

Please visit this page to clear all LQ-related cookies. Bash Syntax Checker What is this strange biplane jet aircraft with tanks between wings? more hot questions default about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation Science Other

Last edited by T3RM1NVT0R; 12-28-2011 at 02:52 PM. 1 members found this post helpful.

You could also try splitting the condition into two: if [ $# -lt 3 ] || [ $# -gt 3 ]; then echo "Error... surprised I need to google this many pages before running into this answer. –Derek Jul 3 '13 at 6:01 Whats the reason behind this problem? Notices Welcome to LinuxQuestions.org, a friendly and active Linux Community. Integer Expression Expected There are two kinds of messages that you should insert.

Number does not equal 1 As you can see, bash displayed an error message when we ran the script. i will post the updated script in a new answer. –Mr. asked 11 months ago viewed 305 times active 11 months ago Related 1“syntax error: unexpected end of file” simple script0How do I solve this “unexpected '}' syntax error” in my bash http://allconverter.net/syntax-error/syntax-error-end-of-file-unexpected.html Enjoy linux!!! @ David Thanks for clearing quote and code tag stuff.

License GPLv3+: GNU GPL version 3 or later This is free software; you are free to change and redistribute it. Forgetting that will get you the same syntax error: unexpected eof. –Cbhihe Jun 19 '15 at 8:45 This answer is seriously underrated. –yvanscher Feb 11 at 20:27 add a The main problem of your code is that there is no fi keyword to close the if/then/else constructs, hence the unexpected end error! e.g: Say if it is in a folder called 'New Folder', you're bound to come across the error that you've cited.