Don't understand the meaning of a pair of braces in xargs command line
I did 'man xargs', and saw '-I{}' in statement for '-i' OPTION.
The question is: what does '{}' in '-I{}' stand for? Thanks in advance! |
The '{}' is replaced by that what is given to xargs (same principle as with the find command).
Have a look here: Linux / Unix Command: xargs (specifically the -replace[=replace-str], -i[replace-str] part) |
Quote:
The following statement from the link is key to me: Code:
If replace-str is omitted, it defaults to "{}" |
Quote:
Have a look at this example: Code:
$ ls -l test* Code:
$ find . -type d -print | xargs echo Directories: |
Quote:
I'm sorry I forgot to say I'm using debian wheezy 7.2, maybe different distributions/versions have different contents of 'man xargs'. According to the following statement in 'man xargs': Code:
--replace[=replace-str] Code:
ls test\ 01 | xargs -i grep "two" {} Code:
ls test\ 01 | xargs -I {} grep "two" {} Code:
ls test\ 01 | xargs -i grep "two" {} Expect you reply again. :) |
I think we are on the same page (and used the same Distro in this case; Debian).
The reason I gave the examples was due to this: Quote:
This is a better description: Quote:
|
Quote:
And sorry for my bad description/english.:) |
You may find this list of xargs examples handy/educational; I did :)
http://javarevisited.blogspot.sg/201...inux-unix.html |
All times are GMT -5. The time now is 06:34 AM. |