[TUHS] sh: cmd | >file

Sven Mascheck mascheck at in-ulm.de
Sat Jan 4 10:53:50 AEST 2020


On Fri, Jan 03, 2020 at 06:18:00PM +0100, markus schnalke wrote:
> [2020-01-03 11:03] "Brian Zick" <brian at zick.io>

> > I'm curious to know if you have a script you used to prove these correct?
> 
> We have to wait for Sven Mascheck to answer this question. He tested
> the different shells.

I guess Brian meant Steffen. I have no idea what Steffen meant with "proved
correct".

(and I believe Gunnar was not motivated to guarantee his heirloom port
to compete in production environments against modern shell variants with
continued maintenance, yet tried hard that time to find and fix as many bugs
as possible; I tried to help him a little bit that time. Just consider how
much still had been fixed by Sun even after their SVR4 sh. more corner case
bugs to be expected...)

BTW, I just typed ":|>file; echo $?" in a running shell and I was
particularly interested in the early Bourne shell variants. Unfortunately,
I was not able yet to check why the 7thEd sh yields SIGPIPE.

And ":|>>" (append) was just motivated by system call tracing (resulting in
less file IO), while I tried to find out what was happening at all, before
you pointed me to the solution "simple command".

Like you I'm interested in the possible motivations for a redirection to be
a simple command. Thus Warner and Michael really have a point about using
plain redirection only, or in connection with exec, respectively.

Sven



More information about the TUHS mailing list