|
|
|
|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | 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. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
Parsing input paramter in a script
Hi folks I am having a little trouble in parsing a variable read into a ksh script
I have a bunch of variables passed into script test.ksh HOST SERVER JOB1 JOB2 JOB3 JOB4 JOB5 What I want to do is read all the $JOB variables ($JOB1, $JOB2, $JOB3) into a variable and then read that variable in a loop and use the values in a case statement for further use however when I try doing this if [ $# -lt 3 ] then echo usage() echo exit fi J=$3,$4,$5,$6,$7,$8 for JOB in $J do case $JOB in BUPD ) echo $JOB ;; FUPD ) echo $JOB ;; DMMD ) echo $JOB ;; BNMD ) echo $JOB ;; OC10 ) echo $JOB ;; WRPF ) echo $JOB ;; STRT ) echo $JOB ;; CKPS ) echo $JOB ;; CKRT ) echo $JOB ;; esac done This however is reading all the variables in one echo $JOB is returing BUPD,FUPD,DMMD,BNMD,OC10,STRT Can someone help |
| Sponsored Links | ||
|
|
|
|||
|
Thanks tmarikle!!
It worked |
| Sponsored Links |
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| shell script parsing with sed | jjamd64 | UNIX for Dummies Questions & Answers | 5 | 12-11-2007 04:51 PM |
| Help with script parsing a log file | mevasquez | Shell Programming and Scripting | 3 | 11-15-2007 04:15 PM |
| parsing problem with script | mike@freddiemac | Shell Programming and Scripting | 5 | 08-03-2006 04:06 PM |
| making sure a command line paramter is a number | rcunn87 | Shell Programming and Scripting | 3 | 07-13-2006 11:36 AM |
| Asking on taking in and out paramter | blueberry80 | UNIX for Dummies Questions & Answers | 1 | 07-03-2003 12:03 PM |