![]() |
|
|
|
|
|||||||
| 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 |
| Trying to implement case | ssunda6 | Shell Programming and Scripting | 3 | 03-23-2008 02:44 AM |
| Script needed to select and delete lower case and mixed case records | abhilash mn | Shell Programming and Scripting | 1 | 03-17-2008 04:00 AM |
| To CASE or not to CASE, this is my question! | olimiles | Shell Programming and Scripting | 1 | 08-19-2006 01:54 AM |
| Ignore case sensitive in Case Switch | annelisa | Shell Programming and Scripting | 1 | 07-13-2006 01:36 AM |
| lower case to upper case string conversion in shell script | dchalavadi | UNIX for Dummies Questions & Answers | 3 | 05-28-2002 09:07 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Trying to implement case
Hi All,
My requirement is if the record is starting with 0, then do some processing. if starting with 1, some processing else (not with 0 or 1 ) then do some other processing. i tried the following Code:
case "$test" in /^0/) echo "starting with zero ;; /^1/) echo " with one" ;; *) echo "otherwise" esac Tried implementing throuh awk also. Code:
echo $test | awk '
/^0/ { print "starting with zero" }
/^1/ { print "with 1" }
'
Please provide inputs. Regards. |
| Forum Sponsor | ||
|
|