![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Script needed to select and delete lower case and mixed case records | abhilash mn | Shell Programming and Scripting | 1 | 03-17-2008 05: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 |
| how can I restart X server ? | oneivan | UNIX for Dummies Questions & Answers | 6 | 10-16-2002 06:45 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 | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
simple short question...
when you make a case instruction.. read f echo " " case $f in 0) echo "0" ;; 1) echo "1" ;; 2) echo "2" ;; *) echo "unknown";; # how to restart case from line 'read f' ? esac ...just wanna get to the entry when making a false entry. there isn't a chance of goto read f. can anyone help ? thx.. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Code:
f=0
while [ $f -ge 0 ]
do
echo "Enter A Value: \c"
read f
echo " "
case $f in
0)
echo "0"
break
;;
1)
echo "1"
break
;;
2)
echo "2"
break
;;
*)
echo "unknown"
;;
esac
done
|
|
#3
|
|||
|
|||
|
thx...but it's not really working
but I've found your intention...make a while loop (infinite loop for *) and break by the others ( 1,2,3...) ... echo "in: \c" while read f do case $f in 0) echo "0" break;; 1) echo "1" break;; *) echo "unknown command $f - retry" ;; esac done now it's working.....cya |
|
#4
|
||||
|
||||
|
Huh, worked for me. Must be a difference in shell. I am using Korn on an HPUX 11.0 server
|
||||
| Google The UNIX and Linux Forums |