![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using variable in case statement | fialia | Shell Programming and Scripting | 2 | 05-12-2008 01:54 AM |
| case statement | bkan77 | Shell Programming and Scripting | 5 | 09-11-2007 02:54 PM |
| Logical AND within a case statement ?? | hcclnoodles | Shell Programming and Scripting | 1 | 11-10-2006 11:27 AM |
| Case Statement | Zeta_Acosta | Shell Programming and Scripting | 19 | 04-06-2004 01:16 PM |
| case statement | Bab00shka | Shell Programming and Scripting | 1 | 07-15-2002 02:31 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
sh -help with case statement (should be simple)
I'm having an issue running multiple commands in a case statement. If i only run one command it works fine. Am I supposed to use double semi-colons after each statement or do i not need any at all?
here is a snippet of the code: case `uname` in "Linux") echo This is linux. cat $BODY | mail -s "$SUBJECT" email@domain.com echo useradd $USERID -c \"$USERNAME\" #useradd.orig $USERID -c "$COMMENT" ;; "SunOS") echo This is sun. cat $BODY | mailx -s "$SUBJECT" email@domain.com echo useradd $USERID -c \"$USERNAME\" #useradd.orig $USERID -c "$COMMENT" ;; "SCO_SV") echo This is sco. cat $BODY | mail -s "$SUBJECT" email@domain.com echo useradd $USERID -c \"$USERNAME\" #useradd.orig $USERID -c "$COMMENT" ;; *) echo Sorry I do not recognize that OS." ;; esac thanks Last edited by kuliksco; 11-19-2007 at 07:03 PM. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
ugh look like i missed a " above the esac. I got it working!
|
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|