Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

read + timeout

Status
Not open for further replies.

saltbits

Programmer
Jun 1, 2004
27
US
I am writing a #!/bin/sh script on SunOS5.8. I want to read keyboard input and if the input timesout, I want to default to something else. I have looked in forums and found quite a few techniques none of which seem to work for me... MY script looks something like this (there is no IF condition right now):

#!/bin/sh
echo Please Input Number of Days of History to Retain:;
read days;
echo $days;
exit

I have tried TMOUT, TIMELIMIT, etc. They simply dont seem to have any effect and the program continue to wait for my input forever. I want to set it to timeout after 10 secs.

Thanks for any help and apologies for those that have seen this Q a million times. I just couldnt find the answer...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top