Xargs

xargs reads whitespace-separated strings from stdin and passes them as arguments to a command, e.g.

$ echo {00..10}
00 01 02 03 04 05 06 07 08 09 10

$ echo {00..10} | xargs echo
00 01 02 03 04 05 06 07 08 09 10

The -n flag splits the input values into n-sized blocks per-invocation of the command, e.g.

$ echo {00..10} | xargs -n1 echo
00
01
02
03
04
05
06
07
08
09
10

$ echo {00..10} | xargs -n3 echo
00 01 02
03 04 05
06 07 08
09 10

The -t flag prints the command to stderr before executing it, e.g.

$ echo {00..10} | xargs -n3 -t echo
echo 00 01 02
00 01 02
echo 03 04 05
03 04 05
echo 06 07 08
06 07 08
echo 09 10
09 10

The -P flag sets the number of parallel processess to use when invoking the command, e.g.

$ echo {00..10} | xargs -n3 -t -P2 echo
echo 00 01 02
echo 03 04 05
00 01 02
echo 06 07 08
03 04 05
echo 09 10
06 07 08
09 10

The -I flag sets the insertion point for the argument, e.g.

$ echo {00..05} | xargs -n1 -I{} echo foo {} bar
foo 00 bar
foo 01 bar
foo 02 bar
foo 03 bar
foo 04 bar
foo 05 bar

{} is the conventional placeholder but the -I flag can use any string. Omit the placeholder to omit the argument, e.g.

$ echo {00..05} | xargs -n1 -I{} echo foo bar
foo bar
foo bar
foo bar
foo bar
foo bar
foo bar

To add a delay between invocations, wrap the command in a shell invocation, e.g.

$ echo {00..05} | xargs -n1 -I{} sh -c 'echo $1; sleep 0.25' _ {}
00
01
02
03
04
05

Here the _ is a placeholder for $0, the {} becomes $1.