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

Bash Syntax Error End Of File Unexpected

Contents

If that's the case dos2ux should fix that. Is 8:00 AM an unreasonable time to meet with my graduate students and post-doc? Using Map to convert Feet + Inches to Inches in a List of Lists How to handle spending money for extended trip to Europe? Find More Posts by paulsm4 View Blog 04-29-2010, 02:19 PM #8 roxie600 LQ Newbie Registered: Apr 2010 Posts: 5 Original Poster Rep: hi PSM - when I ran your http://gatoisland.com/syntax-error/bash-syntax-error-unexpected-end-of-file.php

Password Protected Wifi, page without HTTPS - why the data is send in clear text? I don't see any problems with it. this innocent-looking snippet will cause the same error: die () { test -n "[email protected]" && echo "[email protected]"; exit 1 } To make the dumb parser happy: die () { test -n I hope this helps.

Syntax Error Unexpected End Of File In Shell Script

run dos2unix file.sh then the problem will be fixed. As Gordon suggested, change that to: if nc -z $Host $Port then ... You are currently viewing LQ as a guest. These are the common things which just slip.

deadeyes View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by deadeyes 04-29-2010, 11:03 AM #3 catkin LQ 5k Club Registered: Dec 2008 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 What are the canonical white spaces? Bash Syntax Error Near Unexpected Token Newline Empty variables Edit the script to change line 3 from: number=1 to: number= and run the script again.

Browse other questions tagged bash shell-script or ask your own question. Bash If How would family relationships change if legal system uses collective punishment? Can filling up a 75 gallon water heater tank without opening a faucet cause damage? Why write an entire bash script in functions?

This is one reason you should test your scripts frequently when you are writing them so there is less new code to test. Bash Syntax Error Redirection Unexpected asked 4 years ago viewed 14026 times active 4 years ago Related 0Bash script throws “syntax error near unexpected token `}'” when run0line 45 Syntax error: unexpected end of file0Syntax Error: PSM Last edited by paulsm4; 04-29-2010 at 12:47 PM. It is useful to know that program flow is happening the way we expect.

Bash If

Problem? By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Syntax Error Unexpected End Of File In Shell Script share|improve this answer answered Aug 23 at 19:49 Rafael Urena 6 add a comment| up vote 0 down vote Apparently, some versions of the shell can also emit this message when Bash Else If Why don't most major game engines use gifs for animated textures?

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 weblink Usage: $0 host database username" exit 0 fi The command: $ ./file.sh arg1 arg2 arg3 Note that "file.sh" must be executable: $ chmod +x file.sh You may be getting that error Frequently, you will do this to a block of code to see if a particular problem goes away. 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 Bash Syntax Error Near Unexpected Token

Which requires more energy: walking 1 km or cycling 1 km at the same speed? Also the usual convention in shell scripts is to put a newline after then and else. Shotts, Jr. http://gatoisland.com/syntax-error/bash-for-loop-syntax-error-unexpected-end-of-file.php I used heredoc inside an if block.

That worked. –Divshah Sep 12 '14 at 4:23 Now I have another issue, it doesn't display the second if part... Syntax Error End Of File Unexpected (expecting Fi ) Browse other questions tagged bash syntax or ask your own question. Please see the output below: $ ./a.sh ./a.sh: 3: ./a.sh: Host: not found ./a.sh: 4: ./a.sh: Port: not found Usage: ping [-aAbBdDfhLnOqrRUvV] [-c count] [-i interval] [-I interface] [-m mark] [-M

I do not get any ether when mining How to increase the population growth of the human race Natural construction Unexpected parent process id in output My home country claims I

Usage: $0 host database username" exit 0 fi share|improve this answer edited Jun 16 '11 at 2:50 answered Jun 16 '11 at 2:39 aaronstacy 2,33833557 i still got the Why don't most major game engines use gifs for animated textures? Contact Us - Advertising Info - Rules - LQ Merchandise - Donations - Contributing Member - LQ Sitemap - Main Menu Linux Forum Android Forum Chrome OS Forum Search LQ Syntax Error End Of File Unexpected (expecting Done ) share|improve this answer answered Feb 3 at 4:44 Sunando Samaddar 43 add a comment| up vote 0 down vote So I found this post and the answers did not help me

You seem to be looking for date +%T -d 'now + 10 seconds'. Yes, of course I'm an adult! share|improve this answer edited Mar 27 '12 at 12:54 answered Mar 27 '12 at 9:27 user unknown 20.7k74290 add a comment| up vote 1 down vote You've got an unclosed quote, his comment is here From this we can determine that the error is occurring on line 5 not line 3.

If those answers do not fully address your question, please ask a new question. @peterh what do you mean? –John Selm Mar 29 '15 at 1:23 add a comment| Is it possible to check for existence of member template just by identifier? Meaning of Guns and ghee How to extrude a face parallel to another? Set "execute" permissions (by running "chmod +rx tmp.sh") 5.

Furthermore, instead of an else block that consists entirely of an if statement, you should use elif. also, what system are you running? (Linux, MacOS, BSD, distro, etc) –aaronstacy Jun 16 '11 at 2:47 add a comment| up vote 0 down vote I just cut-and-pasted your example into Unexpected parent process id in output What type of sequences are escape sequences starting with "\033]" Problem with using pause and onslide in one frame Is the standard Canon 18-55 lens share|improve this answer answered Mar 27 '12 at 9:27 camh 20.9k64048 1 Awesome!

Consider what happens if a variable is set to equal nothing. Thanks again for your help roxie600 View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by roxie600 04-30-2010, 12:18 AM #13 grail LQ I set the permissions to 777 and +x so it should work with the 'sh' command, right... more hot questions question feed lang-bsh about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation

Hot Network Questions How to deal with a very weak student?

© Copyright 2017 gatoisland.com. All rights reserved.