[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
xargs documentation
From: |
Eric Blake |
Subject: |
xargs documentation |
Date: |
Sat, 27 Aug 2005 19:07:53 -0600 |
User-agent: |
Mozilla Thunderbird 1.0.2 (Windows/20050317) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The documentation for xargs could use several improvements. The Invoking
`xargs' section of the info pages do not mention -E or -L, and implies
that -I's argument is optional when it is not. Showing the difference
between -i and -I may be useful:
$ echo 1 | xargs -i echo echo {} echo # replace {} in 'echo {} echo'
echo 1 echo
$ echo 1 | xargs -iecho echo {} echo # replace echo in '{} echo'
{} 1
$ echo 1 | xargs -I echo echo {} echo # replace echo in '{} echo'
{} 1
$ echo 1 | xargs -Iecho echo {} echo # replace echo in '{} echo'
{} 1
It also fails to mention that -L and -n are mutually exclusive, and that
since -i/-I implies -L1, that the use of -i and -n is order-dependent. As
an example,
$ echo -e '1\n2' | xargs -i -n 2 echo {}
{} 1 2
$ echo -e '1\n2' | xargs -n 2 -i echo {}
1
2
Meanwhile, the output of 'xargs --help' is pretty sparse, especially when
compared with the --help output of other GNU utilities such as ls(1), and
fails to mention -L, -E, or -I.
- --
Life is short - so eat dessert first!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDEQ5p84KuGfSFAYARAtxYAJ0QyGBfeOGgKWIpyNjNSCii22fAggCgigKD
NS2Ipw4TllV5Z9sUZR+KdeI=
=NZ1E
-----END PGP SIGNATURE-----
- xargs documentation,
Eric Blake <=