> Try:
>
> echo 1 2 3 4 5 6 7 8 9 | xargs -n 4 echo
>
> Now consider what would happen with the above suggested construct with
> a very long file list.
>
> I don't see a problem with adding an option to cp to treat the first
> argument as the target instead of the last argument. It's a simple
> solution, the code change is simple, and it produces the exact desired
> result. What's the problem?
Unfortunatly, cp is not alone in needing this feature.
I think a more sensable approach would be to add an "append args"
flag to xargs. For example "--", which could be used like so:
xargs cp -- destdir <<EOF
first_file
second_file
third file
EOF
would run
cp 'first_file' 'second_file' 'third file' destdir
to pass an argument of two or more dashes to the command,
add an extra dash like so:
xargs echo -- foo --- bar ------ bar <<EOF
first_file
second_file
third file
EOF
would run
echo 'first_file' 'second_file' 'third file' foo -- bar ----- bar
You get the idea.
brad
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message