From owner-freebsd-hackers Sat Sep 27 19:25:45 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id TAA28654 for hackers-outgoing; Sat, 27 Sep 1997 19:25:45 -0700 (PDT) Received: from word.smith.net.au (ppp20.portal.net.au [202.12.71.120]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id TAA28647 for ; Sat, 27 Sep 1997 19:25:40 -0700 (PDT) Received: from word.smith.net.au (localhost.smith.net.au [127.0.0.1]) by word.smith.net.au (8.8.7/8.8.5) with ESMTP id LAA03408; Sun, 28 Sep 1997 11:53:10 +0930 (CST) Message-Id: <199709280223.LAA03408@word.smith.net.au> X-Mailer: exmh version 2.0zeta 7/24/97 To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) cc: hackers@FreeBSD.ORG Subject: Re: Timeout for sh(1) 'read' ?? In-reply-to: Your message of "Sat, 27 Sep 1997 16:42:50 +0200." <19970927164250.YQ59393@uriah.heep.sax.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 28 Sep 1997 11:53:06 +0930 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > 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. OK. To be added are : -t -d Such that if no input is received after seconds, will be returned, or the empty string if is not supplied. > 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. This is more complicated; our sh currently does not exhibit this behaviour unless -e is specified, ie. -r is its "normal" behaviour and -e specifies the POSIXish escaping. I could do with some guidance from people likely to be bitten by this; is such a major change in the name of POSIX worthwhile? mike