From owner-freebsd-hackers Sat Sep 27 22:50:44 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id WAA08871 for hackers-outgoing; Sat, 27 Sep 1997 22:50:44 -0700 (PDT) Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id WAA08866 for ; Sat, 27 Sep 1997 22:50:41 -0700 (PDT) Received: (from uucp@localhost) by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id HAA29711 for hackers@FreeBSD.ORG; Sun, 28 Sep 1997 07:50:30 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.8.7/8.8.5) id HAA00205; Sun, 28 Sep 1997 07:34:31 +0200 (MET DST) Message-ID: <19970928073430.CC50911@uriah.heep.sax.de> Date: Sun, 28 Sep 1997 07:34:30 +0200 From: j@uriah.heep.sax.de (J Wunsch) To: hackers@FreeBSD.ORG Subject: Re: Timeout for sh(1) 'read' ?? References: <19970927164250.YQ59393@uriah.heep.sax.de> <199709280223.LAA03408@word.smith.net.au> X-Mailer: Mutt 0.60_p2-3,5,8-9 Mime-Version: 1.0 X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <199709280223.LAA03408@word.smith.net.au>; from Mike Smith on Sep 28, 1997 11:53:06 +0930 Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk As Mike Smith wrote: > > 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. Oh no! Please don't introduce options with a different meaning than in ksh. ksh93 uses -d delim for an alternate line delimiter character than newline, and does not provide for a default value. I see a need for the -t timeout parameter, since it's basically not possible to catch it otherwise without going through major hoops (due to shell-internal variable assignments that are required, so you can't e.g. easily employ a subshell). However, assigning default values is something that is reasonably covered by things like: $foo=${foo:-default} (Implementing -r) > 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? Well, it's hard to proclaim Posix conformance otherwise. I thought that was one of our goals. I doubt anybody would notice the change... (But if you wanna know my personal opinion: the Posix way is stupid. They should at least have made it the other way round. However, the LNEXT character is IMHO not standardized by Posix, so this explains the backslash mess they are proposing.) -- 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. ;-)