Date: Sat, 27 Sep 1997 16:42:50 +0200 From: j@uriah.heep.sax.de (J Wunsch) To: hackers@FreeBSD.ORG Subject: Re: Timeout for sh(1) 'read' ?? Message-ID: <19970927164250.YQ59393@uriah.heep.sax.de> In-Reply-To: <19970927163558.WP09379@uriah.heep.sax.de>; from J Wunsch on Sep 27, 1997 16:35:58 %2B0200 References: <199709260748.RAA00456@word.smith.net.au> <19970927163558.WP09379@uriah.heep.sax.de>
next in thread | previous in thread | raw e-mail | index | archive | help
I wrote: > TMOUT If set to a value greater than zero, TMOUT > will be the default timeout value for the > read built-in command. The select compound > command terminates after TMOUT seconds when > input is from a terminal. Otherwise, the > shell will terminate if a line is not > entered within the prescribed number of sec- > onds while reading from a terminal. NB: pdksh only implements the last of the three features (at least my version)... > read [ -Aprs ] [ -d delim] [ -t timeout] [ -u > unit] [ vname?prompt ] [ vname ... ] ...nor does it support -t timeout. Adding -t timeout seems to be the best way to me. ${TMOUT} is just confusing given the multitude of things it's going to do. Btw., if you're going to do this, please do also implement -r. It seems to be mandated by Posix.2: By default, unless the -r option is specified, backslash (\) shall act as an escape character, as described in 3.2.1. <snip> 3.2.1 Escape Character (Backslash) A backslash that is not quoted shall preserve the literal value of the following character, with the exception of a <newline>. If a <newline> follows the backslash, the shell shall interpret this as line continuation. The backslash and <newline> shall be removed before splitting the input into tokens. (That is, the backslash should act like ^V.) -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19970927164250.YQ59393>