![]() |
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 |
| 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 |
| Shell script getting input from output | aspect_p | Shell Programming and Scripting | 1 | 03-11-2008 07:37 AM |
| Problem with shell script...ORA-00904:invalid identifier | bhagat.singh-j | Shell Programming and Scripting | 12 | 11-13-2006 10:33 AM |
| Input to shell script | castlerock | Shell Programming and Scripting | 3 | 04-03-2006 05:26 AM |
| Masking input in a shell script | Spetnik | UNIX for Dummies Questions & Answers | 2 | 12-29-2003 03:12 PM |
| single input shell script? | quipy | Shell Programming and Scripting | 1 | 10-03-2002 08:18 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Shell Script Menus - Rejecting invalid input (KSH)
Greetings all,
I'm currently writing a shell script menu which is dynamically populated from an array. Have a question to ask about the filtering of invalid input. I'm using KSH. A brief description of my algorithm is as follows: 1) Read in input from user and store in a variable. (a valid input would be a numerical value) 2) Use an if conditional to determine if this variable if smaller than the total number of elements in an array. If so, print out some value and break out of the infinite while loop (a while true loop). Otherwise, print error statement and let loop iterate again. The code is as follows: Quote:
Thanks in advance. Last edited by rockysfr; 06-26-2007 at 03:55 AM.. Reason: messy program source code |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|