![]() |
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 |
| awk user input | gefa | Shell Programming and Scripting | 17 | 10-30-2007 05:01 AM |
| Restricting the user *LINUX RED HAT* | vakharia Mahesh | UNIX for Dummies Questions & Answers | 4 | 03-07-2007 12:29 PM |
| Getting user input | stevefox | Shell Programming and Scripting | 3 | 02-16-2007 02:09 AM |
| user input date | gundu | Shell Programming and Scripting | 10 | 03-21-2005 03:50 PM |
| Accepting User Input | scott78 | Shell Programming and Scripting | 1 | 01-13-2004 02:54 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
|
|
||||
|
Hi,
I want the user to enter only numeric values and also he should only enter 2 digits only ( eg 23 or 23 or 03 any 2 digits) For the above purpose how should i declare my variable ? integer value if I read 03 in variable value then it gives me error ...also user can enter n number of digits ..how can i restrict it to only 2 digits ... Thanks ... |
|
||||
|
some problem
Quote:
|
|
|||||
|
From man sh
Code:
read [-ers] [-u fd] [-t timeout] [-a aname] [-p prompt] [-n nchars] [-d
delim] [name ...]
-n nchars
read returns after reading nchars characters rather than
waiting for a complete line of input.
Or a more generalized way would be to see what this post holds - making a .sh wait for user input |
![]() |
| Bookmarks |
| Tags |
| regex, regular expressions |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|