asked 3 years ago viewed 6094 times active 3 years ago Related 7Syntax error : end of file unexpected (expecting “fi”)85Makefiles with source files in different directories1Undefined reference error in a So even if the script successfully started at some point in your testing, it would have aborted once line 68 was reached. What does an 'ü' mean? First, let me say there is nothing wrong with line 3. check over here
How can I pull a wire through a pipe that has too many turns for fish tape? Join them; it only takes a minute: Sign up Shell Script Syntax Error: Unexpected End of File up vote 8 down vote favorite 2 In the following script I get an Ubuntu Ubuntu Insights Planet Ubuntu Activity Page Please read before SSO login Advanced Search Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk syntax error: unexpected end How much could a time traveler earn by selling a smartphone from 2016 in 2000?
It's most probably missing fi or } somewhere, but without indentation you won't ever see where. –Jan Hudec Mar 27 '12 at 9:17 What is the assignment to value How could banks with multiple branches work in a world without quick communication? Technical term for Internet-like network? Syntax Error Unexpected End Of File In Linux so that one can select proper file format like unix/mac etc..
The "=" is a binary operator; that is, it expects two items to operate upon - one on each side. Syntax Error End Of File Unexpected (expecting Fi ) Notices Welcome to LinuxQuestions.org, a friendly and active Linux Community. As you gain experience tracking down bugs, you will discover that bugs are often not where you first expect to find them. 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
You will see a problem develop at a certain point in your program and assume that the problem is there. Intuition behind Harmonic Analysis in Analytic Number Theory What type of sequences are escape sequences starting with "\033]" How to deal with a very weak student? Bin Sh C Line 1 Syntax Error Unexpected End Of File 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 End Of File Unexpected (expecting Done ) Does mean=mode imply a symmetric distribution?
This was really helpful. check my blog catkin View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by catkin View Blog 04-29-2010, 11:20 AM #4 roxie600 LQ Newbie Registered: Apr This brings up an important thing to remember when you are writing your scripts. Is this how it's supposed to look? Syntax Error End Of File Unexpected (expecting Then )
Meaning of Guns and ghee How much could a time traveler earn by selling a smartphone from 2016 in 2000? So what's wrong with line 5? You probably think that by removing the "1" on line 3 it created a syntax error on line 3, but it didn't. http://gatoisland.com/syntax-error/bash-syntax-error-unexpected-end-of-file.php And please indent consistently. #!/bin/bash declare -i s declare -i m declare -i h if (( $3 < 50 )); then s=$3+10 m=$2 h=$1 elif (( $2 < 50 )); then
Skeletal formula for carbon with two double bonds Plot of the image of a circle by some functions Does the verb 'to busy' require a reflexive pronoun? Syntax Error Unexpected End Of File In Php A common problem will be that you will make a false assumption about the performance of your program. Due to Ubuntu's DashAsBinSh affinity I suspect your script is interpreted by dash instead of bash.
Could Hillary Clinton have declined to defend Thomas Taylor? This is one reason you should test your scripts frequently when you are writing them so there is less new code to test. Fixed by running dos2unix on the script, with proper description of problem and solution given in that answer share|improve this answer answered Feb 6 '15 at 9:47 shtolik 352613 add a Syntax Error Unexpected End Of File Bash Also note that I made a few styling changes to your script.
Now, that leaves me puzzled. –soufrk Sep 1 at 7:07 add a comment| up vote 3 down vote If the shebang is not on the first line, it will not be command is syntactically invalid, and you need a space before the closing bracket of an if test. I meant : elif (( $2 < 59 )); then s=$3-50 m=$2+1 h=$1 else s=$3-50 m=0 h=$1+1 fi –Sam Jun 3 '12 at 18:40 add a comment| up vote 0 down have a peek at these guys 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
There is nothing about this line running as sudo that should stop it working to my knowledge, does anyone have any ideas? In line 5, the shell substitutes the value of number where it sees $number. 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 Watching your script run It is possible to have bash show you what it is doing when you run your script.
Not the answer you're looking for? Religious supervisor wants to thank god in the acknowledgements How does Coruscant get food? current community chat Stack Overflow Meta Stack Overflow your communities Sign up or log in to customize your list. Is it possible to check for existence of member templates just by an identifier?
How to book a flight if my passport doesn't state my gender? If you'd like to contribute content, let us know. 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 Number does not equal 1 As you can see, bash displayed an error message when we ran the script.
The second type displays the value of a variable (or variables) used in a calculation or test.