bug-findutils  

ls * | xargs --counter=^ --replace=_ "echo argument number ^ is _"

Lars Thon
Wed, 25 Jan 2012 17:20:29 -0800

xargs wishlist item:

a method for accessing an xargs running argument count so that the
count can be used in the command to be executed by xargs:

For example, the syntax could be as follows:

ls * | xargs --counter=^ --replace=_ "echo argument number ^ is _"

The counter should perhaps be 0-based, or 1-based, or N-based (programmable
initial value).
  • ls * | xargs --counter=^ --replace=_ "echo argument number ^ is _" Lars Thon