![]() |
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 |
| 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| case in script | jazz8146 | UNIX for Dummies Questions & Answers | 8 | 04-28-2008 06:23 AM |
| How does the environment stay set | gzs553 | Shell Programming and Scripting | 1 | 03-18-2008 12:21 PM |
| Script needed to select and delete lower case and mixed case records | abhilash mn | Shell Programming and Scripting | 1 | 03-17-2008 08:00 AM |
| ksh script: 'exit' being treated as 'break 2' | gsatch | Shell Programming and Scripting | 4 | 08-11-2003 12:59 PM |
| lower case to upper case string conversion in shell script | dchalavadi | UNIX for Dummies Questions & Answers | 3 | 05-29-2002 01:07 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
how to break within a case/esac and stay in script
Wrote the following loop to but if I use exit, then I break entirely from my script, but instead I want to break from the case/esac and go to the next line in my script. I guess I need to know how to exit gracefully from a "while (true). Also, how can I allow the user to enter upper or lowercase as valid responses. An "A", will be treated the same as an "a", without replicating logic?
while (true) do echo " a b c " echo " Enter one of the environments from above: \c" read reply case $reply in a) echo a is valid & exit ;; b) echo b is valid & exit ;; c) echo c is valid & exit ;; *) echo $reply is not valid - try again esac done |
|
||||
|
I have a query on this break. I am using a program where I am using a while loop to execute it. It will get into a file take the first file and then ping it and if the ip is reachable then it will mail. Now what happens is that when i ping the ip it does nopt come out of the loop and it says "reply from reply from" . I need to usse a break statemetn to come out of this. Can you assist me in this.
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|