The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages 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 07:57 PM
Giving "read" from standard input a timeout. rello Shell Programming and Scripting 10 07-08-2005 08:54 AM
About the Timeout lyh003473 SUN Solaris 4 07-24-2004 09:12 PM
timeout csaunders HP-UX 5 02-27-2004 10:54 AM
how to set timeout for aix? ichiro UNIX for Dummies Questions & Answers 3 01-27-2004 06:36 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-09-2005
ashterix ashterix is offline
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!
  #2 (permalink)  
Old 12-09-2005
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
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.
  #3 (permalink)  
Old 12-09-2005
jim mcnamara jim mcnamara is online now Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,748
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.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:16 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0