Date: Sun, 28 Sep 1997 15:33:13 +0930 From: Mike Smith <mike@smith.net.au> To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) Cc: hackers@FreeBSD.ORG Subject: Re: Timeout for sh(1) 'read' ?? Message-ID: <199709280603.PAA04849@word.smith.net.au> In-Reply-To: Your message of "Sun, 28 Sep 1997 07:34:30 %2B0200." <19970928073430.CC50911@uriah.heep.sax.de>
next in thread | previous in thread | raw e-mail | index | archive | help
> 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.
Ok.
> 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}
Hmm. Actually, you would get the desired behaviour with
val=${default}
read -t 5 val
because read won't have had a chance to modify 'val' if it does time
out. So should read return an error if it times out? What does ksh do?
> (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...
This is where I'm not so sure. Naturally, POSIX is desirable (if
stupid), I just don't want to get stomped for violating POLA.
mike
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709280603.PAA04849>
