Home > Syntax Error > Bash Case Syntax Error

Bash Case Syntax Error

Contents

However, I cannot duplicate your results exactly. The ;;& operator is like ;;, except the case statement doesn't terminate after executing the associated list - Bash just continues testing the next pattern as though the previous pattern didn't Prompt User with Yes or No In most of the software installation, during license agreement, it will ask yes or no input from user. Be sure you have opened the script up with a text editor on the server to check for hidden characters. Check This Out

Here is the code: Code: while : do clear echo "-----Menu for Camera Save Script-----" echo " Main Menu " echo "-------------------------------------" echo "[1] Save to dir: Todays date/time" echo "[2] Examples Another one of my stupid examples… printf '%s ' 'Which fruit do you like most?' read -${BASH_VERSION+e}r fruit case $fruit in apple) echo 'Mmmmh... This is similar to the alternate form Bash supports for its for loops, but Bash doesn't support this syntax for case..esac. btw thanks for quick replies mattyspatty View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by mattyspatty 05-05-2006, 06:27 PM #6 dive Senior

Bash Syntax Error Near Unexpected Token Done'

Browse other questions tagged shell or ask your own question. If you'd like to contribute content, let us know. Reason: Please use code tags Remove advertisements Sponsored Links snakemasterAK View Public Profile Find all posts by snakemasterAK #2 11-06-2010 drl Registered Voter Join share|improve this answer answered Sep 29 '10 at 4:59 Dennis Williamson 167k42235305 Those would generate 'command not found' errors, not a syntax error.

The time now is 08:34 PM. - Contact Us - Unix & Linux - unix commands, linux commands, linux server, linux ubuntu, shell script, linux distros. - Advertising - Top You can also simply drop me a line to say hello!. Why? Bash Syntax Error Near Unexpected Token Then' Join them; it only takes a minute: Sign up case in bash: “line 4: syntax error near unexpected token `)'” up vote 1 down vote favorite case in bash: line 4:

i found some on the web and mashed em together to create this: Code: case "$1" in start) echo "STARTING SERVER... There is nothing out of the ordinary on the console and nothing in the error log. This lets somebody browsing the question listing know that this question already has a valid answer without the need to actually click on it and read the comments. –Joseph R. I was making some changes today, but everything seemed fine.

How to deal with a very weak student? Bash Syntax Error Near Unexpected Token Do' asked 11 months ago viewed 889 times active 9 months ago Related 0bash syntax error when using case statement1bash - syntax error near unexpected token `<'0makefile in ubuntu giving bash syntax The new bash 4 patterns make it possible to use case to validate replies. Join them; it only takes a minute: Sign up Shell Scripting Case issue up vote 0 down vote favorite I am trying to make a shell script that takes arguments and

Bash Syntax Error Near Unexpected Token Else'

Windows takes '\r\n', Linux takes '\n' and MAC OS takes '\r' as the end of line. Link shweta October 31, 2012, 9:19 am @ Chris F.A. Bash Syntax Error Near Unexpected Token Done' by removing the for loop –Hector Gaston Oct 24 '15 at 2:07 @HectorGaston glad it helped (don't forget to accept if it did)! Bash Syntax Error Near Unexpected Token Fi' share|improve this answer edited Sep 29 '10 at 5:09 answered Sep 29 '10 at 4:52 Jonathan Leffler 437k61507821 Thank you.

And just so that there is no confusion, put the sha-bang line as the first line: #!/bin/bash No spaces in that. his comment is here Johnson October 31, 2012, 11:51 am Escape the asterisk or it will be expanded. Does mean=mode imply a symmetric distribution? And welcome to the StackOverflow community! –Lambda Ninja Oct 24 '15 at 2:08 1 Parsing the output of ls is generally a bad idea. $( ls ) will break on Bash Syntax Error Invalid Arithmetic Operator

Bash Case Example 3. Read more about Ramesh Natarajan and the blog. Using cat -v problem02.sh(-v means to show nonprinting character) and check carefully at line 7, whether there is some output containing '^R' or '^M'. http://sovidi.com/syntax-error/bash-if-syntax-error.php Is the following extension of finite state automata studied?

I pasted the whole thing at pastebin.com under the name: whole bashrc file-amai14 (Here [link] (pastebin.com/2scppXxi) Please have a look! –user2561310 Sep 23 '13 at 13:50 add a comment| 2 Answers Bash Syntax Error Near Unexpected Token Newline' spectral norm of block-wise sums of matrices How could banks with multiple branches work in a world without quick communication? You can take it out.

Is it required?1Looping through lines in file using bash and passing to variable.

If not, why? What does Sauron need with mithril? Otherwise, it is the exit status of the last command executed in list. Bash Syntax Error Unexpected End Of File Didn't know about that one. –desertwebdesigns Sep 29 '10 at 5:10 add a comment| up vote 2 down vote You have spaces around your equal signs in this section: case $VERSION

Resulting variable is not the same value as file, why? Dennis numbers 2.0 Meaning of Guns and ghee How to handle spending money for extended trip to Europe? It comes from ksh and is available in ksh, bash (since 4.0, 2009) and zsh (since 3.1.2, 1997). ;;& is bash-specific. –Stéphane Chazelas May 10 '13 at 13:34 3 Also navigate here Is my workplace warning for texting my boss's private phone at night justified?

Try 'help' as the first argument."' I'm trying to have my script interpret help and then make anything else output the next line. (Note this is just an example of a Not the answer you're looking for? Follow us on Google+ Follow us on Twitter Become a fan on Facebook Support Us Support this blog by purchasing one of my ebooks. Using kill command, it sends the corresponding signal to the given process id.

Why does Windows show "This device can perform faster" notification if I connect it clumsily? Join our community today! Should indoor ripened tomatoes be used for sauce? Link KHALIQ February 8, 2015, 3:37 pm In a unix directory there are five applications and qa,init,prod when i run a start.sh it should pick up whatever env I give .can

This: [nN] | [n|N][O|o] ) Should be this: [nN] | [nN][Oo] ) Link s kumar September 1, 2011, 12:35 am 1. Why does Windows show "This device can perform faster" notification if I connect it clumsily? Is this safe to display MySQL query error in webpage if something went wrong? Never noticed that option before. –Joe May 11 '13 at 21:58 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign

Contact Us - Advertising Info - Rules - LQ Merchandise - Donations - Contributing Member - LQ Sitemap - Main Menu Linux Forum Android Forum Chrome OS Forum Search LQ What slm meant by accepting the answer, however, is to click on the tick mark button under the vote buttons to the left of the answer. This site is not affiliated with Linus Torvalds or The Open Group in any way. The name "Vim" is an acronym for "Vi IMproved" because Vim was created as an extended version of the vi editor, with many additional features designed to be helpful in editing

Meaning of "soul-sapping" What could cause the throttle to stick in my Ford Ranger? zaichik View Public Profile View LQ Blog View Review Entries View HCL Entries Visit zaichik's homepage! Please visit this page to clear all LQ-related cookies. Wiki syntax is allowed: Please fill all the letters into the box to prove you're human.

This script has no meaning and might not even make sense, it's just a test.) linux bash syntax-error case share|improve this question edited Dec 7 '15 at 20:17 Tomasz Jakub Rup I am receiving "syntax error near unexpected token `in" and "case "$y" in" #!/bin/sh echo "Variable name \$1 $1" echo "Variable name \$2 $2" echo "Variable name \$3 $3" y=$2 echo