Date: Tue, 24 Jun 2003 21:43:56 -0700 From: John-Mark Gurney <gurney_j@efn.org> To: Tim Kientzle <kientzle@acm.org> Cc: Artem 'Zazoobr' Ignatjev <timon@memphis.mephi.ru> Subject: Re: tcsh being dodgy, or pipe code ishoos? Message-ID: <20030625044356.GW57612@funkthat.com> In-Reply-To: <3EF922BE.4070803@acm.org> References: <20030624183515.A42570@FreeBSD.org> <1056499632.662.7.camel@timon.nist> <3EF922BE.4070803@acm.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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@big-lizard:~)39% ( echo 1 ; ( ( echo 2 ; echo 3 ) | xargs -I% > >>echo + % ) ) > >>1 > >>+ 2 > >>+ 3 > >>(jmallett@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."
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030625044356.GW57612>