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

Syntax Error Unexpected End Of File Shell

Contents

Are there too few Supernova Remnants to support the Milky Way being billions of years old? Yes, my password is: Forgot your password? Who is spreading the rumour that Santa isn't real? Why does Davy Jones not want his heart around him? his comment is here

Should a country name in a country selection list be the country's local name? Furthermore, instead of an else block that consists entirely of an if statement, you should use elif. It felt so wrong to have un-indented code in the block, but it's absolutely necessary. –Zeal Jul 6 at 17:50 add a comment| up vote 2 down vote echo"==================PS COMMAND SNAPSHOT==============================================================" Feynman diagram and uncertainty Word that includes "food, alcoholic drinks, and non-alcoholic drinks"?

Syntax Error: Unexpected End Of File Bash

The time now is 11:24 PM. - Contact Us - UNIX & Linux - unix commands, linux commands, linux server, linux ubuntu, shell script, linux distros. - Advertising - Top Will majority of population dismiss a video of fight between two supernatural beings? 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 Finding the desired way later means double work in such spaghetti code.

To understand this error, we have to see what the shell sees. Thanks. –thiagowfx Nov 16 '14 at 3:53 1 thanks a lot :) –clement Dec 17 '14 at 16:47 1 +1 Also applies to code snippets with brackets like so: What are some counter-intuitive results in mathematics that involve only finite objects? Shell Script Validator Review your favorite Linux distribution.

Make text field readonly Square root image filter tool in Python Are there too few Supernova Remnants to support the Milky Way being billions of years old? Bash Unexpected End Of File While Looking For Matching Search Forums Show Threads Show Posts Tag Search Advanced Search Unanswered Threads Find All Thanked Posts Go to Page... linux operating commands and unix operating commands IF section problem. dos2ux file1 > file2 share|improve this answer answered Mar 11 at 13:27 patel8786 362 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up Browse other questions tagged bash unix shell or ask your own question.

there's something non-unix character embedded on my code! Delimited By End-of-file (wanted `eof') I strongly suggest that you look at the documentation for your editor to see if there is a way to set the characters used as line terminators. If that's the case dos2ux should fix that. Regards, Adrian Jedrzejewski jedzio View Public Profile Find all posts by jedzio

#4 07-31-2014 Don Cragun Administrator Join Date: Jul

Bash Unexpected End Of File While Looking For Matching

My script: Code: returned=`tail -50 SapLogs.log | grep -i "Error"` echo $returned if [ -n "${returned}" ]; then echo "There is no errors in the logs" fi And after execution of How could I have modern computers without GUIs? Syntax Error: Unexpected End Of File Bash Help my maniacal wife decorate our christmas tree Who is spreading the rumour that Santa isn't real? Syntax Error Unexpected End Of Input use (( )) for arithmetic comparison. –geirha Jun 3 '12 at 14:47 @geirha Oh, yes, of course.

catkin View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by catkin View Blog 04-29-2010, 12:20 PM #4 roxie600 LQ Newbie Registered: Apr this content A simple it didn't work for me suffices. Anxious about riding in traffic after 20 year absence from cycling more hot questions question feed lang-sh about us tour help blog chat data legal privacy policy work here advertising info 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? Syntax Error Near Unexpected Token `fi'

Missing quotes Edit line 6 to remove the trailing quote from the end of the line: echo "Number equals 1 and run the script again. asked 4 years ago viewed 14439 times active 4 years ago Related 0Bash script throws “syntax error near unexpected token `}'” when run0line 45 Syntax error: unexpected end of file0Syntax Error: Also the usual convention in shell scripts is to put a newline after then and else. http://allconverter.net/syntax-error/syntax-error-near-unexpected-token-do-shell.html Linux Forum XenForo style by Pixel Exit current community blog chat Server Fault Meta Server Fault your communities Sign up or log in to customize your list.

In this particular case, I can see you are missing a fi. Syntax Error Near Unexpected Token `done' You have to check that. If you ever got to execute this line, you'd see an error bash: fi: command not found.

Dave ilikejam View Public Profile View LQ Blog View Review Entries View HCL Entries Visit ilikejam's homepage!

You could also try splitting the condition into two: if [ $# -lt 3 ] || [ $# -gt 3 ]; then echo "Error... What are the ground and flight requirements for high performance endorsement? Contact Us Advertising Positioningby Digital Point Terms and Rules Forum software by XenForo™ ©2010-2015 XenForo Ltd. Unexpected End Of File Photoshop Isolating problems Finding bugs in your programs can sometimes be very difficult and frustrating.

How do I reassure myself that I am a worthy candidate for a tenure-track position, when department would likely have interviewed me even if I wasn't? Find More Posts by paulsm4 View Blog 04-29-2010, 06:30 PM #12 roxie600 LQ Newbie Registered: Apr 2010 Posts: 5 Original Poster Rep: Thank you so much! share|improve this answer answered Aug 23 at 19:49 Rafael Urena 161 This was exactly my case. check over here Unix & Linux Stack Exchange works best with JavaScript enabled current community chat Stack Overflow Meta Stack Overflow your communities Sign up or log in to customize your list.

For example, when we were looking for our missing quotation we could have done this: #!/bin/bash number=1 if [ $number = "1" ]; then echo "Number equals 1 #else # echo I set the permissions to 777 and +x so it should work with the 'sh' command, right... share|improve this answer edited Mar 27 '12 at 12:54 answered Mar 27 '12 at 9:27 user unknown 21.1k74292 add a comment| up vote 1 down vote You've got an unclosed quote, UNIX is a registered trademark of The Open Group.

It worked before. Letter of Recommendation Without Contact from the Student Most useful knowledge from the 30's to understand current state of computers & networking? All Rights Reserved. And, now for the good news...

share|improve this answer answered Mar 29 '15 at 4:15 Janis 7,8771531 Thanks for the reply. was there any more error output? If you execute it like this it should work: Your "file.sh": #!/bin/bash # june 2011 if [ $# -lt 3 -o $# -gt 3 ]; then echo "Error... In the latter part of your code, you have 5 ifs and 4 fis.