From owner-freebsd-current@FreeBSD.ORG Tue Jun 24 21:47:07 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 931) id 2A75A37B401; Tue, 24 Jun 2003 21:47:07 -0700 (PDT) Date: Tue, 24 Jun 2003 23:47:07 -0500 From: Juli Mallett To: Tim Kientzle Message-ID: <20030624234707.A59666@FreeBSD.org> References: <20030624183515.A42570@FreeBSD.org> <1056499632.662.7.camel@timon.nist> <3EF922BE.4070803@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3EF922BE.4070803@acm.org>; from kientzle@acm.org on Tue, Jun 24, 2003 at 09:19:10PM -0700 X-Title: Code Maven X-Towel: Yes X-Negacore: Yes X-Authentication-Warning: localhost: juli pwned teh intarweb cc: freebsd-current@freebsd.org cc: "Tim J. Robbins" cc: Artem 'Zazoobr' Ignatjev Subject: Re: tcsh being dodgy, or pipe code ishoos? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jun 2003 04:47:07 -0000 * Tim Kientzle [ Date: 2003-06-24 ] [ w.r.t. Re: tcsh being dodgy, or pipe code ishoos? ] > 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. How about this, it essentially says that in the not -P case, no procs may be unwaited-on, whereas otherwise we say that 1 may be unwaited-on.. Thanx, juli. %%% Index: xargs.c =================================================================== RCS file: /home/ncvs/src/usr.bin/xargs/xargs.c,v retrieving revision 1.54 diff -d -u -r1.54 xargs.c --- xargs.c 13 Jun 2003 17:05:41 -0000 1.54 +++ xargs.c 25 Jun 2003 04:45:39 -0000 @@ -123,7 +123,7 @@ /* 1 byte for each '\0' */ nline -= strlen(*ep++) + 1 + sizeof(*ep); } - maxprocs = 1; + maxprocs = 0; while ((ch = getopt(argc, argv, "0E:I:J:L:n:oP:pR:s:tx")) != -1) switch(ch) { case 'E': %%% -- juli mallett. email: jmallett@freebsd.org; efnet: juli;