The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ssh/scp - can you specify timeout? frustrated1 Shell Programming and Scripting 3 01-02-2008 04:57 PM
Giving "read" from standard input a timeout. rello Shell Programming and Scripting 10 07-08-2005 05:54 AM
About the Timeout lyh003473 SUN Solaris 4 07-24-2004 06:12 PM
timeout csaunders HP-UX 5 02-27-2004 07:54 AM
how to set timeout for aix? ichiro UNIX for Dummies Questions & Answers 3 01-27-2004 03:36 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 12-09-2005
Registered User
 

Join Date: Nov 2005
Location: cyberjaya
Posts: 85
ksh read timeout

any idea on how to timeout the read statement for ksh?

for bash u can use read -t option
-t timeout
Cause read to time out and return failure if a complete
line of input is not read within timeout seconds. This
option has no effect if read is not reading input from
the terminal or a pipe.

thanks in advance!
Reply With Quote
Forum Sponsor
  #2  
Old 12-09-2005
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,699
Not sure, if this is the right answer. man ksh says

Code:
       TMOUT  If set to a positive integer in an interactive shell, it  speci-
              fies the maximum number of seconds the shell will wait for input
              after printing  the  primary  prompt  (PS1).   If  the  time  is
              exceeded, the shell exits.
Reply With Quote
  #3  
Old 12-09-2005
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,298
I think he means
Code:
read -t10  variable_name
This works in the newer versions of the Korn shell like Korn93. Otherwise, Perderabo has posted examples of timing out a read by using coprocesses. Search the form on read timeout.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 06:20 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0