I want:
echo -n 'file1 file2 file3' | xargs -d ' ' -I{} cp {} /somedir
to behave like:
cp file1 file2 file3 /somedir
but it doesn't...
It also looks like when including the -I{} option, the -d option makes xargs behave differently. It seems like it tries to pass each argument to a separate command call rather than all of them toa single one.
For example, this works:
echo -n 'file1 file2' | xargs -d' ' diff
But this fails
echo -n 'file1 file2' | xargs -d' ' -I{} diff {}
With error:
diff: missing operand after 'file1'
diff: Try 'diff --help' for more information.
diff: missing operand after 'file2'
diff: Try 'diff --help' for more information.
How can I get echo -n 'file1 file2 file3' | xargs -d ' ' -I{} cp {} /somedir to behave as intended
0 comments:
Post a Comment
Thanks