Home > Syntax Error > Syntax Error Near Unexpected Token Fi' Cygwin

Syntax Error Near Unexpected Token Fi' Cygwin

Contents

Display a Digital Clock How do I politely decline a research grant? Still I don't like your if expression, there's no point to use test command there. Syntax error in terminal1case in bash: “line 4: syntax error near unexpected token `)'”0Bash scripting: syntax error near unexpected token `done' Hot Network Questions French vs Italian resistance Secret salts; why Why would Snape set his office password to 'Dumbledore'? his comment is here

How do I reassure myself that I am a worthy candidate for a tenure-track position, when department would likely have interviewed me even if I wasn't? share|improve this answer answered Aug 2 '15 at 23:58 Tony Williams 5,38911034 +1 terse yes, baby steps –fd0 Aug 3 '15 at 0:04 add a comment| Your Answer More info here Also there's no need to use \n in every echo, because echo places newlines by default. Lagrange multiplier on unit sphere An expensive jump with GCC 5.4.0 Word for nemesis that does not refer to a person Why do the Avengers have bad radio discipline?

Syntax Error Near Unexpected Token Fi' Cygwin

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 Hot Network Questions Will majority of population dismiss a video of fight between two supernatural beings? This common pitfall is greatly explained here and here. How to decrypt .lock files from ransomeware on Windows Why do the Avengers have bad radio discipline?

asked 1 year ago viewed 597 times active 11 months ago Related 1/shell-script: syntax error near unexpected token `done'2command not found and syntax error near unexpected token2bash: syntax error near unexpected share|improve this answer answered Sep 16 '13 at 8:23 sshilovsky 340213 add a comment| up vote 1 down vote Works for me: $ cat > f.sh #!/bin/bash echo "print a message" vBulletin 2000 - 2016, Jelsoft Enterprises Ltd. Syntax Error Near Unexpected Token `done' asked 2 years ago viewed 607 times active 2 years ago Related 2Bash syntax error when commented out if block content: syntax error near unexpected token `fi'1syntax error near unexpected token

share|improve this answer edited May 4 '14 at 7:23 answered May 3 '14 at 19:06 mklement0 51k10113115 Neither of those solutions worked. :/ –Clucky May 3 '14 at 19:09 Syntax Error Near Unexpected Token For Essentially, your problem is the unbalanced quotes. Is it still safe to drive? Not the answer you're looking for?

Why would Snape set his office password to 'Dumbledore'? Syntax Error Near Unexpected Token (' Bash The shell executes the command [ with the rest as parameters, including the ] as mandatory last parameter. VT-x is not available, but is enabled in BIOS more hot questions question feed lang-sh about us tour help blog chat data legal privacy policy work here advertising info mobile contact Not the answer you're looking for?

Syntax Error Near Unexpected Token For

Is there any financial benefit to being paid bi-weekly over monthly? 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 Near Unexpected Token Fi' Cygwin This is explained here. Syntax Error Near Unexpected Token `then' Hit a curb today, taking a chunk out of the tire and some damage to the rim.

Hit a curb today, taking a chunk out of the tire and some damage to the rim. this content 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 The reason for space before the ] is similar. split strings and add them as new row Why would Snape set his office password to 'Dumbledore'? Syntax Error Near Unexpected Token `else'

Idiomatic Expression that basically says "What's bad for you is good for me" measurable linear functionals are also continuous on separable Banach spaces? Normally, sh is symlinked to bash on CentOS, so your script SHOULD work fine. (As an aside: any POSIX-compliant shell should work with the specific sample script in your question, however. Word for nemesis that does not refer to a person Deep theorem with trivial proof Is including the key as AAD actually dangerous? weblink Lagrange multiplier on unit sphere How can I stun or hold the whole party?

The time now is 04:29 AM. Syntax Error: Unexpected End Of File Unable to understand the details of step-down voltage regulator Does enlarging a character with a reach weapon affect his threat range? Why is bench pressing your bodyweight harder than doing a pushup?

It works for me –Ashkan May 3 '14 at 19:03 Make sure you don't have any funny "whitespace" in the file. –user2864740 May 3 '14 at 19:04

I could edit it out, but the damage has been done. A bit of refactoring, and fixing the quotes First, you have some very long lines containing repeated elements that can easily be refactored, which already makes our job of "fixing" much Is including the key as AAD actually dangerous? Unexpected End Of File Bash How secure is a fingerprint sensor versus a standard password?

asked 3 years ago viewed 22331 times active 4 months ago Related 1/shell-script: syntax error near unexpected token `done'0Shell script - syntax error near unexpected token `['-1Syntax error in bash script: Need a way for Earth not to detect an extrasolar civilization that has radio How to properly localize numbers? General caveat: As @Scrutinizer points out in a comment, invoking bash as sh implies subtle changes in behavior - see http://www.gnu.org/software/bash/manual/html_node/Bash-POSIX-Mode.html (*) - though bashisms still work). check over here Is there any financial benefit to being paid bi-weekly over monthly?

French vs Italian resistance Is the partition function of non-conformal theories on a torus modular invariant? Grass grows through the floor of my building more hot questions question feed lang-bsh about us tour help blog chat data legal privacy policy work here advertising info mobile contact us In addition you need to put the echo output in quotes. share|improve this answer answered May 9 '12 at 19:52 Bram 1,02159 Thank so much guys!

In that example, the string Dhruva is actually outside the quotes, which is probably not what you intended. Should a country name in a country selection list be the country's local name? asked 1 year ago viewed 1169 times active 1 year ago Related 1-Bash command not found appearing every time I start terminal8xcodebuild firing after every terminal command1openAL Terminal ends with Error: asked 5 years ago viewed 19324 times active 5 years ago Related 0Bash script throws “syntax error near unexpected token `}'” when run0Why syntax error near unexpected token `fi' is coming5bash:

That was the issue. 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 Joining two lists with relational operators Help my maniacal wife decorate our christmas tree Idiomatic Expression that basically says "What's bad for you is good for me" more hot questions lang-sh I could have mentioned that in my answer, though. –type_outcast Dec 5 '15 at 5:41 I think #!/bin/sh would be preferred in this case.

Another (abbreviated) example from your script: su "psql -d "Dhruva" blah.sql". Im connecting to our Solaris Server through xShell... The following code is correct: if [ $# -eq 1 ] then echo ok fi Also, these brackets are not actually if condition brackets. A good way to provide a wrong answer first, then keep editing before someone else provides the correct answer.

Should a country name in a country selection list be the country's local name? For example, some linux systems will use busybox, dash, ash... So, in your case, sh (or whatever Bourne shell you appear to be using), interprets the quotes as if they're balanced, which results in parts of your script being "quoted" which TV episode or movie where people on planet only live a hundred days and fall asleep at prescribed time Can a free radical be created by chemical reaction of non-radical species?

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 share|improve this answer edited Oct 30 '11 at 13:15 answered Oct 30 '11 at 13:09 Riccardo Murri 10.9k53647 thank you Mr.Riccardo –Beginners Oct 30 '11 at 13:19 add a Removing brace from the left of dcases Why is bench pressing your bodyweight harder than doing a pushup? Run cat -v PreStartupCommands.sh and if ^M is contained in the output, you need to remove CR (\r) instances. –mklement0 May 3 '14 at 19:15 Yup.