> foo bar
or
deprecated form
$ echo "foo" | xargs -i echo {} "bar"
> foo bar
$ echo -e "one\ntwo\nthree" | xargs -I{} sh -c 'echo "$1" > "/tmp/file_$1.txt"' -- {}
Outros exemplos
$ ls -1 | xargs -I{} sh -c "grep ABC '{}' > '{}.out'"
find . -mindepth 1 -maxdepth 1 -type f -exec sh -c "grep ABC '{}' > '{}.out'" \;
No comments:
Post a Comment