ksh read timeout

Tags
shell scripts

Login to Reply

 
Thread Tools Search this Thread
# 1  
Old 12-09-2005
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  
Old 12-09-2005
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  
Old 12-09-2005
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.
Login to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Similar Threads More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ksh to read input until QUI Grueben Shell Programming and Scripting 2 07-20-2017 06:11 AM
While read -a line not working in ksh archana25 Shell Programming and Scripting 2 07-20-2017 05:09 AM
ksh while read issue port43 Shell Programming and Scripting 2 07-24-2015 11:47 AM
Read timeout rprasad Shell Programming and Scripting 8 11-10-2014 09:19 AM
command timeout in ksh vishnudev1 Shell Programming and Scripting 7 09-09-2012 08:51 AM
read sectors from disk failed with timeout wljackhero UNIX for Advanced & Expert Users 0 09-05-2011 12:55 AM
read sectors from disk failed with timeout wljackhero Linux 0 09-05-2011 12:29 AM
read sectors from disk failed with timeout wljackhero Boot Loaders 0 09-02-2011 01:38 AM
simple way to read an array in ksh pravsripad UNIX for Dummies Questions & Answers 1 07-29-2010 12:25 AM
KSH script SQL timeout issue Donkey25 Shell Programming and Scripting 4 05-15-2009 07:58 PM
read from std i/p with timeout within a script Blue_shadow Shell Programming and Scripting 2 04-27-2009 03:48 PM
How to timeout the "read" command rm-r Shell Programming and Scripting 5 08-15-2008 12:22 PM
read from console in ksh ajaykumarns Shell Programming and Scripting 4 12-30-2007 08:06 AM
is there any way to read a line twice in KSH Srini75 Shell Programming and Scripting 6 01-25-2006 01:14 AM
Giving "read" from standard input a timeout. rello Shell Programming and Scripting 10 07-08-2005 09:54 AM
All times are GMT -4. The time now is 12:25 PM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.