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

Syntax Error Near Unexpected Token Fi' Cygwin

Contents

Type type [ to see what is really happening. What mechanical effects would the common cold have? This site is not affiliated with Linus Torvalds or The Open Group in any way. 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? have a peek here

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 If you want TWO newlines to appear, then use echo -e 'start\n' or echo $'start\n' . Is resset.log a typo, or do you really have three different logs? Top Log in or register to post comments Like Leave this field blank Click Here!

Syntax Error Near Unexpected Token Fi' Cygwin

Dec 14 '13 at 19:15 I was only focusing on the syntax error in question, but fair point, I've edited the code to include these quotes. –jprice Dec 14 Thanks so much! 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: TV episode or movie where people on planet only live a hundred days and fall asleep at prescribed time How secure is a fingerprint sensor versus a standard password?

Remove them with dos2unix or a similar tool. –chepner Sep 16 '13 at 13:16 | show 2 more comments 2 Answers 2 active oldest votes up vote 2 down vote Answering Hit a curb today, taking a chunk out of the tire and some damage to the rim. Make sure all the spaces I've described are in place. –jprice Dec 14 '13 at 18:59 You have forgot to quote "$f" –Aleks-Daniel Jakimenko-A. Syntax Error Near Unexpected Token `done' I picked bash out of a hat as the question didn't specify.

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 How to reward good players, in order to teach other players by example Idiomatic Expression that basically says "What's bad for you is good for me" Lagrange multiplier on unit sphere Another (abbreviated) example from your script: su "psql -d "Dhruva" blah.sql". 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

split strings and add them as new row Why would Snape set his office password to 'Dumbledore'? Syntax Error Near Unexpected Token (' Bash This $'' syntax is explained here To make it completely perfect you should place -- before arbitrary filenames, otherwise rm might treat it as a parameter if the file name starts fi When writing #bash if [[ "$ORACLE_SID" != "Test" ]]; then ..... Darn Notepad++ >.> –Clucky May 3 '14 at 19:24 It's a subtle issue; glad you were able to resolve it; perhaps Notepad++ (which I'm not familiar with) can be

Syntax Error Near Unexpected Token For

User contributions on this site are licensed under the Creative Commons Attribution Share Alike 4.0 International License. See gnu.org/software/bash/manual/html_node/Bash-POSIX-Mode.html –Scrutinizer May 3 '14 at 19:38 | show 1 more comment Not the answer you're looking for? Syntax Error Near Unexpected Token Fi' Cygwin But it is always giving a error 'syntax error near unexpected token `fi' ' is it always required to use ';' after if condition brackets. Syntax Error Near Unexpected Token `then' Display a Digital Clock How do I politely decline a research grant?

That was the issue. navigate here Is it unethical to take a photograph of my question sheets from a sit-down exam I've just finished if I am not allowed to take them home? 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 Unable to understand the details of step-down voltage regulator Does enlarging a character with a reach weapon affect his threat range? Syntax Error Near Unexpected Token `else'

Browse other questions tagged bash if-statement terminal centos syntax-error or ask your own question. Is there any financial benefit to being paid bi-weekly over monthly? How to properly localize numbers? Check This Out 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

Does using documentation as a developer make me look unprofessional? Syntax Error: Unexpected End Of File share|improve this answer answered May 9 '12 at 19:52 Bram 1,02159 Thank so much guys! echo "hello World" # a=1 b=2 echo "A: $a" echo "B: $b" if [ "$a" -eq "$b" ]; then echo "equal" else echo "Not equal" fi Every time I run that,

Generally, however, if you're invoking a bash script, it's both conceptually clearer and safer to invoke it with bash - given that sh could have been redefined to invoke a different

Ask Ubuntu works best with JavaScript enabled FAQ Forum Quick Links Unanswered Posts New Posts View Forum Leaders FAQ Contact an Admin Forum Community Forum Council FC Agenda Forum Governance Forum So why restrict the script to bash when it will run with either? 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 Unexpected End Of File Bash macos terminal share|improve this question edited Aug 6 '15 at 5:19 Chris Page 4,3402128 asked Aug 2 '15 at 9:03 dmsquare 11 migrated from stackoverflow.com Aug 2 '15 at 19:08 This

Why are terminal consoles still used? Why is bench pressing your bodyweight harder than doing a pushup? UNIX is a registered trademark of The Open Group. this contact form 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

How to decrypt .lock files from ransomeware on Windows Why are terminal consoles still used? There must be a space between [[ and first operator. 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). Unable to complete a task at work.

Code: if jacksum -c Checksums/$drive/files/checksums|tee /home/$user/temp && grep -v -E ^\\[OK\] /home/$user/temp |grep ^\\[ > /home/$user/results fi Adv Reply Quick Navigation General Help Top Site Areas Settings Private Messages Subscriptions Joining two lists with relational operators What are some counter-intuitive results in mathematics that involve only finite objects? Dec 14 '13 at 19:37 | show 2 more comments up vote 5 down vote Use Notepad ++ and use the option to Convert the file to UNIX format. Im connecting to our Solaris Server through xShell...

Well, that "than" should probably be "then" but I'm not really a scripting expert. (Are you logging in to the "admin" account or is something else referencing the admin profile?) –Phillip For details and our forum data attribution, retention and privacy policy, see here current community blog chat Ask Different Ask Different Meta your communities Sign up or log in to customize I think this did the trick! –dmsquare Aug 3 '15 at 6:25 @dmsquare please mark this as the accepted answer if you are satisfied with it. –Chris Page Aug