tcsh being dodgy, or pipe code ishoos?
John-Mark Gurney
gurney_j at efn.org
Tue Jun 24 21:44:07 PDT 2003
Tim Kientzle wrote this message on Tue, Jun 24, 2003 at 21:19 -0700:
> Artem 'Zazoobr' Ignatjev wrote:
> >Juli Mallett wrote:
> >
> >>Anyone with insight into this?
> >>
> >>(jmallett at big-lizard:~)39% ( echo 1 ; ( ( echo 2 ; echo 3 ) | xargs -I%
> >>echo + % ) )
> >>1
> >>+ 2
> >>+ 3
> >>(jmallett at big-lizard:~)40% ( echo 1 ; ( ( echo 2 ; echo 3 ) | xargs -I%
> >>echo + % ) ) | cat
> >>1
> >>+ +2
> >>3
> >
> >last cat is not necessary...
> >And it's more weird than that:
> >
> >>( echo 1 ; ( ( echo 2 ; echo 3 ) | xargs -I% echo -- + % ) )
> >
> >1
> >-- --+ +2
> >3
> >
>
>
> Hmmm... This looks like xargs isn't waiting for the subcommand
> to exit. This looks like 'echo -- + 2' and 'echo -- + 3' are
> running concurrently.
Yes, but the default xargs w/ -n is only one concurrently, which would
mean that tcsh is returning a valid return value before it writes.
I have gotten the 3 to appear before the 2.
> ( ( echo 2 ; echo 3 ) | xargs -I% /bin/echo + % )
+ 3
+ 2
(btw, I can see this on sparc w/ tcsh, not bash or sh)
--
John-Mark Gurney Voice: +1 415 225 5579
"All that I will do, has been done, All that I have, has not."
More information about the freebsd-current
mailing list