![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| while loop inside while loop | panknil | Shell Programming and Scripting | 0 | 01-07-2008 12:49 PM |
| while , for loop ? | Georgesaa | UNIX for Advanced & Expert Users | 1 | 04-18-2007 01:34 PM |
| do...while loop | cubs0729 | Shell Programming and Scripting | 1 | 09-26-2005 01:49 PM |
| rsh and for loop | newbee2005 | Shell Programming and Scripting | 4 | 09-16-2005 10:46 AM |
| how to get the similar function in while loop or for loop | trynew | Shell Programming and Scripting | 3 | 06-17-2002 12:09 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Loop help...
Hi, I'm starting to learn about shell scripts. The following is my basic script... Code:
echo "Please enter your first name: \c" read firstname echo "Please enter your last name: \c" read lastname echo "Your name is $firstname $lastname. Is that correct?" select BOOLEAN in Yes No do if [[ -z "$BOOLEAN" ]] then echo "Incorrect choice. Choose again!" else echo "Welcome $firstname $lastname" break fi done My problem is that when it comes to the choosing 'Yes' or 'No', if I select NO, the code will continue as if I selected YES. However, if I select NO, I want the code to keep asking the user to retype their name until they say YES. Can someone help me? Thanks. |
| Bookmarks |
| Tags |
| shell script, shell scripting, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|