Date: Tue, 24 Jun 2003 23:47:07 -0500 From: Juli Mallett <jmallett@FreeBSD.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: <20030624234707.A59666@FreeBSD.org> In-Reply-To: <3EF922BE.4070803@acm.org>; from kientzle@acm.org on Tue, Jun 24, 2003 at 09:19:10PM -0700 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 <kientzle@acm.org> [ 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030624234707.A59666>
