Zsh Mailing List Archive
Messages sorted by:
Re: Test failure in redirect.
- X-seq: zsh-workers 16561
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: Zefram <zefram@xxxxxxxx>
- Subject: Re: Test failure in redirect.
- Date: Tue, 5 Feb 2002 05:22:55 +0000
- Cc: zsh-workers@xxxxxxxxxx
- In-reply-to: <20020205024622.GA24127@xxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20020131064103.12082.qmail@xxxxxxxxxxxxxxxxxxxxxxx> <1020204184533.ZM24919@xxxxxxxxxxxxxxxxxxxxxxx> <20020204210337.GA4456@xxxxxxxx> <1020205023130.ZM28214@xxxxxxxxxxxxxxxxxxxxxxx> <20020205024622.GA24127@xxxxxxxx>
On Feb 5, 2:46am, Zefram wrote:
} Is there any precedent for echo/print being silent about a closed stdout
} but complaining about other error conditions?
I'd be happy with reverting it to the old state where it was silent about
all write errors. It was changed because of a Debian bug report; the
precedent, if any, was embodied in A04redirect.ztst.
We generally haven't created tests for behavior that was known to be wrong
without in some way marking it as such. As the test code from more than a
year ago was specifically testing for successful exit of print to a closed
stdout, somebody (probably PWS) must at some point have believed that to
be the correct behavior.
} The only argument I see for not treating a closed stdout as an error
} when one attempts to write to it is to allow >&- to be used to throw
} away output. What's wrong with >/dev/null?
There's no requirement that /dev/null exist in order for zsh to compile
and run. There has in the past been a pure Windows port of zsh, even
though it's sort of been superceded by the Cygwin build now.
} Is there a significant amount of code that uses >&- instead of >/dev/null?
I couldn't say if there's a "significant" amount, but closing stdout to
supress output was not an uncommon scripting hack in the past. (I'd say
the "distant" past, but that would make me feel old.)
} >E.g. here's bash:
} >[schaefer@zagzig schaefer]$ echo foo >&-
} >[schaefer@zagzig schaefer]$ echo $?
} >[schaefer@zagzig schaefer]$
} I get results inconsistent with that:
} zefram@bowl:~> echo foo >&-; echo $?
} zefram@bowl:~> echo foo >/dev/full; echo $?
I get $? of 0 for both of those, with bash-2.0.3. So even returning an
error status is a fairly recent development.
} How does your version handle >/dev/full?
bash-2.0.3 gives no error message and returns 0 on write to /dev/full.
(I verified that `cat > /dev/full' on the same machine gives the "no
space on device" error.)
Bart Schaefer Brass Lantern Enterprises
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by: