Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Jun 2002 11:45:00 -0400
From:      Garance A Drosihn <drosih@rpi.edu>
To:        Mikhail Teterin <mi+mx@aldan.algebra.com>, Juli Mallett <jmallett@FreeBSD.ORG>
Cc:        arch@FreeBSD.ORG
Subject:   Re: feature request for xargs
Message-ID:  <p0511178cb938f5a581d7@[128.113.24.47]>
In-Reply-To: <200206211033.03948.mi%2Bmx@aldan.algebra.com>
References:  <200206200706.g5K76M514469@freefall.freebsd.org> <200206202012.17801.mi%2Bmx@aldan.algebra.com> <20020620175700.A96462@FreeBSD.ORG> <200206211033.03948.mi%2Bmx@aldan.algebra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
At 10:33 AM -0400 6/21/02, Mikhail Teterin wrote:
>On Thursday 20 June 2002 08:57 pm, Juli Mallett wrote:
>= I'd been hesitant on this, until we were clear on how it could
>= and would be used, but an arch@ review is probably enough :)

I think it could be a useful option.

>Here is the usage, for which I currently use make(1). [...].
>This works good, but may be done simpler with something like
>
>	echo *.JPG | xargs -n1 -j2 <script>

Note that it would be:
         echo *.JPG | xargs -n 1 -j 2 <script>

(with blanks after -n and -j :-)

>
>All operations, involving many light tasks can benefit, i.e.
>
>	find /some/dir \! -type d -print0 | xargs -0 -j0 rm -f

It's not clear to me that this specific case would benefit.
If you have a large number of files, then this will spawn
off a large number of processes, only to see those processes
fight with each other over updating entries in the
directories (as well as fighting with the 'find' itself,
as it searches through those very same directories).  You
might want to do the above to clean out /usr/obj/usr/src,
for instance, but I suspect that would be a bad idea.

In thinking about that example, I wonder if we should not allow
'-j 0' to spawn infinite processes.  Maybe allow a -j value
from 1 to 64 (or some other arbitrary number), just to reduce
the chances of a one-line "fork bomb".

-- 
Garance Alistair Drosehn            =   gad@gilead.netel.rpi.edu
Senior Systems Programmer           or  gad@freebsd.org
Rensselaer Polytechnic Institute    or  drosih@rpi.edu

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?p0511178cb938f5a581d7>