![]() |
|
|
|
|
|||||||
| 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 |
| sh -help with case statement (should be simple) | kuliksco | Shell Programming and Scripting | 1 | 11-19-2007 07:04 PM |
| case statement | bkan77 | Shell Programming and Scripting | 5 | 09-11-2007 02:54 PM |
| with Regard to Case Statement | cosec | Shell Programming and Scripting | 4 | 09-03-2007 11:15 PM |
| 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
|
|||
|
|||
|
How can i convert this case statement that i made to an if statement? Do not write script, just give a hint on how to do something below.
#!/bin/sh hi="$1" case "$hi" in [Hh][iI]) exit 0;; * ) exit 1;; esac echo "$hi" Here is what i got so far for an if statement: hi="$1" if test "$hi" = hi (this is where i am stuck... how can i make it include hi and also HI? then exit 0 else exit 1 fi |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
hmm, just a hint, eh?
man ksh search for "if" read it. You can also man egrep You can also buy the O'Reilly published Bill Rosenblatt authored Learning The Korn Shell. (sounds like a classroom assignment to me but I can give hints Carl |
|
#3
|
|||
|
|||
|
nevermind, after tinkering a while i got it to work. Mod you can close this thread now.
|
|||
| Google The UNIX and Linux Forums |