* Tim Kientzle <[EMAIL PROTECTED]> [ 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?
> >>
> >>([EMAIL PROTECTED]:~)39% ( echo 1 ; ( ( echo 2 ; echo 3 ) | xargs -I% echo + % ) )
> >>1
> >>+ 2
> >>+ 3
> >>([EMAIL PROTECTED]:~)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: [EMAIL PROTECTED]; efnet: juli;
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to