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

Syntax Error: Unexpected End Of File Bash

Contents

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 Tic Tac Toe - C++14 Separate namespaces for functions and variables in POSIX shells My advisor refuses to write me a recommendation for my PhD application unless I apply to his Split python tuple in subtuples with capacity limit in functional programming style "Squeezing out of a dead man" proverb Why is this Sudoku Skyscraper Failing? or recreate the script in linux iteself. Source

There are two kinds of messages that you should insert. current community chat Unix & Linux Unix & Linux Meta your communities Sign up or log in to customize your list. EOF Or let it know you're tabbing it(and it must be a tab): ... 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:

Syntax Error: Unexpected End Of File Bash

It's whitespace sensitive so you either strip it back: ... Why don't miners get boiled to death at 4 km deep? I get this error message : "sub_change_dirrect: line 14: syntax error: unexpected end of file" bash scripts share|improve this question edited Jun 3 '12 at 12:54 adempewolff 5,74011943 asked Jun 3

UNIX is a registered trademark of The Open Group. Find More Posts by paulsm4 View Blog 04-29-2010, 02:58 PM #10 roxie600 LQ Newbie Registered: Apr 2010 Posts: 5 Original Poster Rep: Am still getting the end of file So what's wrong with line 5? Syntax Error Unexpected End Of File Python How to draw a clock-diagram?

How exactly do I mark this as answered? Bash Unexpected End Of File While Looking For Matching Put fi on a line of its own (or put a ; before it). [ "$3" < 50 ] is the same as [ "$3" ] < 50 — it's the http://sourceforge.net/projects/basheclipse/ Paolo Supino, 2012/01/02 10:20 not knowing of bash debugger existance I wrote a small script (I called debug.sh) that sets -x, -xv or -xvn (depending on the parameter passed debug.sh). This site is not affiliated with Linus Torvalds or The Open Group in any way.

And at least 4 spaces per indentation level at that, so you can really see the structure. Syntax Error: End Of File Unexpected (expecting What are the large round dark "holes" in this NASA Hubble image of the Crab Nebula? Enable Wireless on Fresh Debian Build Why do the Sparkfun and Adafruit Eagle libraries use smaller footprints than the manufacturer's recommended land pattern? But it's working very strange.

Bash Unexpected End Of File While Looking For Matching

Keep adding :) –Shobhit Puri May 14 '15 at 23:07 add a comment| Did you find this question interesting? http://askubuntu.com/questions/340767/unexpected-eof-in-a-bash-script-why And remove the spaces in the assignment: Host = ############### Port = #### so that becomes: Host=############### Port=#### because assignments will not work properly if there are spaces. Syntax Error: Unexpected End Of File Bash Subscribed! Syntax Error Unexpected End Of Input How to make Skyscanner, Kiwi, Kayak include ground transfer in the search Why was Susan treated so unkindly?

What game is the guard playing in this picture? http://fullflash.net/syntax-error/syntax-error-unexpected-end-of-file-shell-script.html Why can't the second fundamental theorem of calculus be proved in just two lines? It's pretty hard to understand the code like this. Partial sum of the harmonic series between two consecutive fibonacci numbers What to do when majority of the students do not bother to do peer grading assignment? Shell Script Validator

Please enter you password now:" b if [ "$b" = "123456789" ] then echo "You really are LouRae!! 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 If you get weird and illogical messages from your script, rule out the possibility that^M is involved. have a peek here Nobody 235 add a comment| Not the answer you're looking for?

For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. Syntax Error Near Unexpected Token `fi' What object can prove the equations? Number does not equal 1 As you can see, bash displayed an error message when we ran the script.

There's a big difference in the way that UNIX® and Microsoft® (and possibly others) handle the line endings of plain text files.

  1. Does the reciprocal of a probability represent anything?
  2. The time now is 06:18 PM.
  3. Given that ice is less dense than water, why doesn't it sit completely atop water (rather than slightly submerged)?
  4. IMHO it all should be a single site with content nicely separated by "site-tags" (this question should be site-tagged SO and Linux). –maaartinus Jun 19 '14 at 22:09 add a comment|

You probably think that by removing the "1" on line 3 it created a syntax error on line 3, but it didn't. Why don't miners get boiled to death at 4 km deep? Find More Posts by ilikejam 04-29-2010, 12:30 PM #6 catkin LQ 5k Club Registered: Dec 2008 Location: Tamil Nadu, India Distribution: Debian Posts: 8,576 Blog Entries: 31 Rep: The Delimited By End-of-file (wanted `eof') Isolating problems Finding bugs in your programs can sometimes be very difficult and frustrating.

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 about ... In our first try (when number=1), the shell substituted 1 for $number like so: if [ 1 = "1" ]; then However, when we set number to nothing (number=), the shell http://fullflash.net/syntax-error/syntax-error-near-unexpected-token-bash-function.html It is pointing at the line whee the function is called. #!/bin/sh expected_diskusage="264" expected_dbconn="25" expected_httpdconn="20" expected_cpuusage="95" #expected_fd="100" httpdconn=`ps -ef|grep -i httpd|grep -v grep|wc -l` #httpd connections cpu_usage=`ps aux|awk 'NR > 0

Introduction to Linux - A Hands on Guide This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started the script can't be executed The error message can vary. 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 Mark the answer as accepted, instead, by clicking on the tick next to it.

If the default colors are not suitable than you can set the environment varialbes script_color linenum_color funcname_color to any of the following colors: ${darkgrey}darkgrey$nc, ${lightgrey}light grey$nc, ${white}white, ${red}red, ${lightred}light red, ${green}green, The best way to spot these is to use correct indentation, which will show you where you have a broken control structure, and syntax highlighting, which will show you where quotes Plugin for Eclipse. Does DFT produces the same output as FFT?

Disproving Euler proposition by brute force in C Does DFT produces the same output as FFT? Number sets symbols in LaTeX Why were Navajo code talkers used during WW2? These unmatched errors occur with: double-quote pairs single-quote pairs (also $'string'!) missing a closing } with parameter expansion syntax Too many arguments bash: test: too many arguments You most likely forgot share|improve this answer edited Mar 27 '12 at 12:54 answered Mar 27 '12 at 9:27 user unknown 20.8k74290 add a comment| up vote 1 down vote You've got an unclosed quote,

Remember that "[" is an abbreviation for the test shell builtin. My advisor refuses to write me a recommendation for my PhD application unless I apply to his lab How do we play with irregular attendance? You seem to be looking for date +%T -d 'now + 10 seconds'. 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

Main Menu LQ Calendar LQ Rules LQ Sitemap Site FAQ View New Posts View Latest Posts Zero Reply Threads LQ Wiki Most Wanted Jeremy's Blog Report LQ Bug Syndicate Latest 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 share|improve this answer answered Mar 29 '15 at 4:15 Janis 7,7771531 Thanks for the reply. Browse other questions tagged command-line bash scripts or ask your own question.