|
|
|
|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | 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. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
Strange behavior from 'read' statements. (ksh - but could be same on other shells)
I'm getting rather frustrated with an interactive script I'm writing.
The script is divided up, with section for setting variable at the top, then functions (which make up most of the script) then basically a line at the end which calls the first function- the program moves between the functions to do it's thing. The problem I'm having is when I'm using 'read' to ask the user to 'press return to continue' or suchlike, at some points in the script this works FINE, however at other points it just continues straight through the 'read' without waiting for input or anything. Using 'read -u' had no effect, I have also replaced all these prompts with the following function; pressreturn() { echo echo "Press <RETURN> to continue." read BLANK } This has had no positive effect, the script still ignores the read statement some of the time! I'm using ksh version M-11/16/88f on AIX 5.2 Thanks for your time on this, folks. I know I havn't provided too much information, I was just hoping this was a not-uncommon gotcha that a few of you might have come up against at one point or another. If anyone requires further information please shout and I'll supply whatever you need. Regards, Alex |
| Sponsored Links |
|
|
|
|||
|
Many thanks, Perderabo, that worked a treat. Can you explain, or preferably point me to a website/free resource where I can read up on why your solution works. I have a few guesses but this whole thing has highlighted large gaps in my knowledge of UNIXland...
Again, many thanks! |
|
|||
|
Does this happen without me explicitly requesting it. I know that from the shell you can do this by calling <program> thus '<program> < inputfile', is this what you mean? If so, then how is this happening when I'm not requesting it? Thanks and regards - Alex.
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| strange behavior of find with xargs | jerardfjay | Shell Programming and Scripting | 9 | 08-09-2007 09:06 AM |
| Very Strange Behavior for redirection | cahook | Shell Programming and Scripting | 5 | 08-08-2007 12:32 PM |
| Strange Real Memory usage behavior | Skyybugg | AIX | 5 | 05-31-2007 11:17 AM |
| Strange Behavior on COM2 | Elwood51 | UNIX for Dummies Questions & Answers | 0 | 08-02-2006 04:31 PM |
| strange sed behavior | Kevin Pryke | UNIX for Dummies Questions & Answers | 5 | 06-13-2003 05:34 AM |