Home > Unexpected End > Unexpected End Of File Error In Linux

Unexpected End Of File Error In Linux

Contents

Browse other questions tagged bash shell scripting or ask your own question. You have to watch for differences in the various shells. –slm♦ Feb 8 '14 at 3:48 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote accepted Browse other questions tagged linux shell-script fedora virtual-machine or ask your own question. What the shell was trying to tell us was that there was only one item and there should have been a unary operator (like "!") that only operates on a single http://centralpedia.com/unexpected-end/unexpected-end-of-file-error-php.html

Remember that "[" is an abbreviation for the test shell builtin. Former boss asking me to do presentations Is it dangerous to use default router admin passwords if only trusted users are allowed on the network? I mean, If I put the number 13 it just ends, it doesn't say "Creo que esto ya no es un mes!" –Divshah Sep 12 '14 at 4:24 @Divshah: Minimum of a function on an open interval Why does Wikipedia list an improper pronunciation of Esperanto? http://stackoverflow.com/questions/9886268/shell-script-syntax-error-unexpected-end-of-file

Syntax Error Unexpected End Of File Shell Script

Does Nietzsche's rejection of Socrates mean that he is a relativist about ethics? My advisor refuses to write me a recommendation for my PhD application unless I apply to his lab What object can prove the equations? making new symbol from two symbols Are assignments in the condition part of conditionals a bad practice? command <<-EOF ...

Btw., CR is a young beta site with hardly anyone wasting their time there. –maaartinus Jun 19 '14 at 19:38 @maaartinus Crud - I thought since it said 'peer 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 Output a googol copies of a string What game is the guard playing in this picture? Shell Script Validator grail View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by grail Thread Tools Show Printable Version Email this Page Search this Thread Advanced

more hot questions question feed lang-sh about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation paulsm4 View Public Profile View LQ Blog View Review Entries View HCL Entries Visit paulsm4's homepage! This time you should get the following: [[email protected] me]$ ./trouble.bash /trouble.bash: [: =: unary operator expected. http://unix.stackexchange.com/questions/193165/syntax-error-unexpected-end-of-file-bash-script Hot Network Questions What would have happened to the world if the sepoy mutiny of 1857 had suceeded?

Enable Wireless on Fresh Debian Build Before I leave my company, should I delete software I wrote during my free time? Syntax Error Near Unexpected Token `fi' UNIX is a registered trademark of The Open Group. How to select citizen justices? Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

Syntax Error Unexpected End Of File Bash

So what's wrong with line 5? http://unix.stackexchange.com/questions/114138/shell-unexpected-end-of-file-error You will sometimes want to set a variable's value to nothing. Syntax Error Unexpected End Of File Shell Script so that one can select proper file format like unix/mac etc.. Bash Unexpected End Of File While Looking For Matching Solutions?

Levrel , I didn't use id command in if statement, please reread my code. –PersianGulf Mar 22 at 21:53 1 @L.Docherty reality sorry, I think I answered you via bashism. http://centralpedia.com/unexpected-end/unexpected-end-of-file-error.html Remember that the shell spends a lot of its life substituting text. asked 2 years ago viewed 19492 times active 3 months ago Related 0Shell script - syntax error near unexpected token `['2bash: syntax error near unexpected token `}'-1Syntax error in bash script: I will continue working that way from now on. Syntax Error Unexpected End Of Input

Best way to repair rotted fuel line? 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 How to fix a bent lens mount hook? have a peek at these guys For example.: #!/bin/bash number=1 set -x if [ $number = "1" ]; then echo "Number equals 1" else echo "Number does not equal 1" fi set +x Previous | Contents |

share|improve this answer answered Mar 13 '14 at 5:10 musthafa 112 add a comment| up vote 0 down vote I had the issue this issue when I wrote the script in Delimited By End-of-file (wanted `eof') By doing this, you can isolate which part of a program is causing (or not causing) a problem. How much more than my mortgage should I charge for rent?

if ( $no > 900 ) then set m=3 else if ( $no > 450 && $no < 901) set m=2 else set m=1 endif http://beefchunk.com/documentation/tips/unix_tips_and_tricks/node40.html share|improve this answer answered May

Contact Us - Advertising Info - Rules - LQ Merchandise - Donations - Contributing Member - LQ Sitemap - Main Menu Linux Forum Android Forum Chrome OS Forum Search LQ Every polynomial with real coefficients is the sum of cubes of three polynomials How to create a custom theme in SXA? I haven't built any checking though, but that's left as exercise for the student! ;) –val0x00ff Mar 22 at 22:02 Thanks, what do you mean by checking? Syntax Error Unexpected End Of File Python Does the reciprocal of a probability represent anything?

I have simplified my code majorly and still get the same error so there's obviously something wrong with my basic syntax. #usr/bin/sh if [$1 -lt $2]; then echo "done" else echo A number cannot be at the same time less than 0 and greater than 12, so your second condition can never be true. Is there a formal way of saying 'hog'? http://centralpedia.com/unexpected-end/unexpected-end-of-file-error-in-php.html 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

Is Certificate validation done completely local? How to create a custom theme in SXA? Does the reciprocal of a probability represent anything? You are currently viewing LQ as a guest.

about ... Here is what it looks like: [[email protected] me]$ ./trouble.bash + number=1 + '[' 1 = 1 ']' + echo 'Number equals 1' Number equals 1 Alternately, you can use the set First, let me say there is nothing wrong with line 3. What is the "Chairman Tree"?

Use that instead. –Stéphane Chazelas May 26 '14 at 8:54 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote A quick Google search reveals that your UNIX is a registered trademark of The Open Group. Why does Deep Space Nine spin? Post back the results 8.

Success! I am confused, I have an if statement at last and it looks correct! 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 Why can't the second fundamental theorem of calculus be proved in just two lines?

Try our newsletter Sign up for our newsletter and get our top new questions delivered to your inbox (see an example). share|improve this answer answered Mar 27 '12 at 9:27 camh 21.1k64048 1 Awesome!