bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing the partition number of file arguments to xargs?


From: Sven Hartrumpf
Subject: Re: Accessing the partition number of file arguments to xargs?
Date: Mon, 22 Dec 2008 10:23:59 +0100 (CET)

Sun, 21 Dec 2008 23:10:48 +0000, jay wrote:
> To be honest it's a little difficult to evaluate your question without
> a fuller understanding of your use case.  From what you say so far, it
> appears to perhaps be that you want to use %I to use as a hash key
> allowing you to select one of several parallel backend services in
> some kind of fair manner.

Yes.

> If however, you are trying to do something like this I would encourage
> you to use an auxiliary script to do it.  You could maintain the
> sequence number in a file and use advisory locks to arbitrate access
> to it, for example.

Sure, that is an option, but xargs would easily have this information ...
An alternative (with more general possibilities) would be %P:
the position of the first argument of the current processor-program call.

Greetings
Sven

Attachment: pgptU_cYJ86Ak.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]