How do I handle an unterminated wire behind my wall? I used heredoc inside an if block. or recreate the script in linux iteself. Why is the size of my email so much bigger than the size of its attached files? check over here
You are currently viewing LQ as a guest. Try changing it to #!/bin/bash catkin View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by catkin View Blog 04-29-2010, 12:43 PM #7 Code: cat -vet script_name shamrock View Public Profile Find all posts by shamrock #4 07-02-2008 alias_juju Registered User Join Date: Jul 2008 Last Activity: 3 To do this, create the following script called trouble.bash.
This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. up vote 3 down vote favorite I can't normally run sh scripts. Is it dangerous to use default router admin passwords if only trusted users are allowed on the network? Syntax Error Near Unexpected Token `fi' Die Liebe höret nimmer auf Enable Wireless on Fresh Debian Build Why don't miners get boiled to death at 4 km deep?
Keep adding :) –Shobhit Puri May 14 '15 at 23:07 add a comment| up vote 6 down vote In my case, I found that placing a here document (like sqplus ... 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 syntax error: unexpected You will often find that a portion of your program will fail because something that you assumed was correct earlier in your program is, in fact, incorrect and is causing your useful reference Player claims their wizard character knows everything (from books).
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 Delimited By End-of-file (wanted `eof') Commit complete. command-line bash scripts share|improve this question edited Sep 3 '13 at 21:57 Braiam 39.2k1693154 asked Sep 3 '13 at 8:29 user568021 2952619 How do you run the above script? 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
SXA Page Design vs Page Standard Values vs Page Branch Template Why were Navajo code talkers used during WW2? http://www.linuxquestions.org/questions/programming-9/shell-scripting-syntax-error-unexpected-end-of-file-804990/ Last edited by Scott; 07-28-2010 at 05:23 PM.. Syntax Error Unexpected End Of File Bash Is Certificate validation done completely local? Syntax Error Unexpected End Of Input Thanks! –user55570 Jun 17 '15 at 22:35 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign
It's confusing. http://centralpedia.com/unexpected-end/unexpected-end-of-file-error-php.html Thank you in advance .. Are assignments in the condition part of conditionals a bad practice? If that's the case dos2ux should fix that. Shell Script Validator
A common problem will be that you will make a false assumption about the performance of your program. Syntax Error Unexpected End Of File Python So fi is a command, the spaces are important, and  is used for char/strings. Than it work fine –shubham kumar Mishra Feb 12 '15 at 11:51 add a comment| up vote 0 down vote I have found that this is sometimes caused by running a
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==============================================================" Strange device identification How to create a custom theme in SXA? Then, the shell complains that it reaches the end of the script file without finding a then following the if (there's just a then
Use dos2unix or d2u, or issue a :set ff=unix in vim to fix your script file. What was that alien in Doctor Who that nobody saw? Disproving Euler proposition by brute force in C What do you call someone without a nationality? http://centralpedia.com/unexpected-end/unexpected-end-of-file-error.html Lengthwise or widthwise.
To do this, add a "-x" to the first line of your script, like this: #!/bin/bash -x Now, when you run your script, bash will display each line (with substitutions performed) To understand this error, we have to see what the shell sees. It also explains the rest of the error message we received. Browse other questions tagged bash shell-script or ask your own question.
What are the large round dark "holes" in this NASA Hubble image of the Crab Nebula? You can confirm the validity of this by trying it on the command line: [[email protected] me]$ number= [[email protected] me]$ See, no error message. You will sometimes want to set a variable's value to nothing. For example this scripts works ok: echo "hello" it prints "hello" with no errors.
There are two kinds of messages that you should insert. Clean up your code, and errors start to stand out. The question does not have to be directly related to Linux and any language is fair game. I also find that text editors with syntax highlighting (like nedit or kate) make these kinds of bugs easier to find.
Why were Navajo code talkers used during WW2? This site is not affiliated with Linus Torvalds or The Open Group in any way. 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 Set "execute" permissions (by running "chmod +rx tmp.sh") 5.