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!
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.
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
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?
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,
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...