![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using variable in case statement | fialia | Shell Programming and Scripting | 2 | 05-12-2008 05:54 AM |
| case statement | bkan77 | Shell Programming and Scripting | 5 | 09-11-2007 06:54 PM |
| Logical AND within a case statement ?? | hcclnoodles | Shell Programming and Scripting | 1 | 11-10-2006 02:27 PM |
| Case Statement | Zeta_Acosta | Shell Programming and Scripting | 19 | 04-06-2004 05:16 PM |
| case statement | Bab00shka | Shell Programming and Scripting | 1 | 07-15-2002 06:31 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 10:03 PM.. |
![]() |
| Bookmarks |
| Tags |
| linux commands |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|