![]() |
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 |
| how other user cannot read my script? | happyv | Shell Programming and Scripting | 19 | 10-02-2006 11:01 AM |
| Script not waiting for user responce | rdudejr | Shell Programming and Scripting | 3 | 07-05-2006 11:20 AM |
| need to read a file and keep waiting till it satisfies some condition | senthilk615 | Shell Programming and Scripting | 1 | 03-22-2006 03:15 AM |
| booting up but the system was waiting for user interaction at console | stancwong | UNIX for Dummies Questions & Answers | 1 | 11-29-2005 11:51 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
read-waiting for user response
Would there be any reason for why a 'read ans' would not wait for a user's response (i.e user has to hit a key to continue)? I know for sure that it is doing everything else in that part of my 'if' statement but it doesn't wait for me to hit a key before continuing.
The strange thing is that for ans1 - ans3, it waits, then beginning with ans4 - ans7, it just continues as if I had hit a key and I've put breakpoints in but can't figure it out. I'm not sure what would cause this anomaly. I've written many interactive scripts (ksh) with over 5-10 prompts in them and they've always worked fine. I just can't figure out what could cause this one to be so different that it would ignore the wait prompt (read ans4). The code is identical to how I got ans1 - ans3 so I'm just wondering if any of you know/heard of this...this script has lots of validation going on using regexp, grep, etc to validate fields in a file but this should not be causing my problem.... |
|
||||
|
Thanks! That did it. All is working now. So is this the most definite way to ensure that the user is prompted?
As soon as I added the < /dev/tty, all my prompts worked as they should at specified points. Is it good practice then to always do this for every read statement in an interactive script? Would there be a reason why one should not use the redirection every time? Gianni |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|