Home > Unexpected End > Bash Unexpected End Of File While Looking For Matching

Bash Unexpected End Of File While Looking For Matching


The script : #!/bin/bash declare -i s declare -i m declare -i h if [ "$3" < 50 ]; then s=$3+10 m=$2 h=$1 else if ["$2" < 50 ]; then s=$3-50 I should have asked what editor you were using! share|improve this answer edited Feb 11 '14 at 6:35 Maverick 1,01221942 answered Feb 11 '14 at 6:13 Praveen Rao K 6111 1 This! 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 http://fullflash.net/unexpected-end/syntax-error-unexpected-end-of-file-bash-script.html

It worked before. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own. I have check other solutions on stackoverflow, however I coul not solve the here. Why is the FBI making such a big deal out Hillary Clinton's private email server? http://unix.stackexchange.com/questions/193165/syntax-error-unexpected-end-of-file-bash-script

Bash Unexpected End Of File While Looking For Matching

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 share|improve this answer answered Mar 27 '12 at 9:24 ams 15.4k22655 add a comment| up vote 1 down vote I had this problem when running some script in cygwin. 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 Fixed.

  1. 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.
  2. Do pulled hair from the root grow back?
  3. Also the usual convention in shell scripts is to put a newline after then and else.
  4. This is one reason you should test your scripts frequently when you are writing them so there is less new code to test.
  5. asked 4 years ago viewed 14214 times active 4 years ago Related 0Bash script throws “syntax error near unexpected token `}'” when run0line 45 Syntax error: unexpected end of file0Syntax Error:
  6. If there isn't any way to set the line terminator to just a newline (AKA linefeed) character, seriously consider learning how to use vi or emacs instead of your current editor.
  7. Put fi on a line of its own (or put a ; before it). [ "$3" < 50 ] is the same as [ "$3" ] < 50 — it's the
  8. Strange device identification Why was Susan treated so unkindly?
  9. Why were Navajo code talkers used during WW2?

Why do we need blockchains? This time you should get the following: [[email protected] me]$ ./trouble.bash /trouble.bash: [: =: unary operator expected. grep "fi " cldtest.sh only reveals 3 matching fi statements. Syntax Error Near Unexpected Token `fi' Search this Thread 04-29-2010, 10:24 AM #1 roxie600 LQ Newbie Registered: Apr 2010 Posts: 5 Rep: Shell Scripting "syntax error : unexpected end of file" hey I am very

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? Syntax Error Unexpected End Of File Bashrc Given that ice is less dense than water, why doesn't it sit completely atop water (rather than slightly submerged)? Is there a word for "timeless" that doesn't imply the passage of time? http://stackoverflow.com/questions/15597766/linux-script-unexpected-end-of-file-error 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

Strange device identification Why does Wikipedia list an improper pronunciation of Esperanto? Delimited By End-of-file (wanted `eof') Die Liebe höret nimmer auf Do pulled hair from the root grow back? How to apply for UK visit visa after four refusal My 21-year-old adult son hates me Do I have to delete lambdas? tail -50 SapAdapterInboundRfc-P30-SapAdapterInboundSynchronous.log | grep -i "Error" >/dev/null when the compound-list is more than about 40 characters long, but that is just my personal preference.

Syntax Error Unexpected End Of File Bashrc

I agree with camh, that correct indentation from the beginning helps to avoid such errors. look at this web-site And remove the spaces in the assignment: Host = ############### Port = #### so that becomes: Host=############### Port=#### because assignments will not work properly if there are spaces. Bash Unexpected End Of File While Looking For Matching Registration is quick, simple and absolutely free. Syntax Error Unexpected End Of Input I am confused a bit now When I add set -xv to script the error appears: Code: : invalid optionne 2: set: - set: usage: set [--abefhkmnptuvxBCHP] [-o option] [arg ...]

or recreate the script in linux iteself. weblink Regards, Adrian Jedrzejewski jedzio View Public Profile Find all posts by jedzio

#4 07-31-2014 Don Cragun Administrator Join Date: Jul Post back the results 8. How do we play with irregular attendance? Shell Script Validator

Using DC in transformers? current community chat Unix & Linux Unix & Linux Meta your communities Sign up or log in to customize your list. I had to run it as bash instead of sh. navigate here Are you sure this is all of your script? –n.m.

Normally you need spaces between the if and brackets, ... Syntax Error Unexpected End Of File Python As Gordon suggested, change that to: if nc -z $Host $Port then ... Why does my capsule collider fall without my object (Unity)?

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

I have found the error and fixed it! –Scott Pearce Mar 29 '15 at 22:09 add a comment| Not the answer you're looking for? How do really talented people in academia think about people who are less capable than them? Please follow the above steps EXACTLY: 1. Syntax Error Near Unexpected Token `done' You seem to be looking for date +%T -d 'now + 10 seconds'.

Modify functions in R using body, formals and environment methods Best way to repair rotted fuel line? Yes, you're correct. Watching order for the Dan Brown films? his comment is here Not the answer you're looking for?

Browse other questions tagged bash scripts or ask your own question. Be sure to enter it exactly as written. #!/bin/bash number=1 if [ $number = "1" ]; then echo "Number equals 1" else echo "Number does not equal 1" fi When you A common problem will be that you will make a false assumption about the performance of your program. How to select citizen justices?

This technique is called tracing. If possible, how to include cut marks in PDF? (using watermark?) Why do the Sparkfun and Adafruit Eagle libraries use smaller footprints than the manufacturer's recommended land pattern? Join our community today! Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle Blogs Recent Entries Best Entries Best Blogs Blog List Search Blogs Home Forums HCL Reviews Tutorials Articles Register Search

Are assignments in the condition part of conditionals a bad practice? Thank you in advance .. My script is if [ "$(/etc/init.d/tomcat7 status)" == " * Tomcat servlet engine is not running." ]; then /etc/init.d/tomcat7 start; fi As suggested I tried creating this in linux and now This brings up an important thing to remember when you are writing your scripts.

It is very strange that the output from the 1st script you showed us did not contain the line: Code: === Checking logs === Please add the following line to your Join them; it only takes a minute: Sign up Linux Script Unexpected end of file error up vote 2 down vote favorite I am new to shell scripting. Split python tuple in subtuples with capacity limit in functional programming style fraction line in French In order to become a pilot, should an individual have an above average mathematical ability? As it's currently written, it’s hard to tell exactly what you're asking.

Finding the desired way later means double work in such spaghetti code. How strange is it (as an undergrad) to email a professor from another institution about possibly working in their lab?