I have copied some files from one user-account to a new one by these commands
$ folders_array=(.mozilla .thunderbird .ssh .eclipse)
$ echo ${folders_array[@]} | xargs -d " " -I _ sudo cp -r _ /home/nebukadnexa/
I can't explain the form of the last argument .eclipse
which is, that it is '.eclipse'$'\n'
and thus wasn't found in my current home directory and thus also wasn't copied of course.
Can you point me to how xargs produces the argument '.eclipse'$'\n'
(being the last argument)?
EDIT: Maybe a better solution than -d " "
is tr " " "\n"
?
echo ${folders_array[@]} | tr " " "\n" | xargs -I _ printf "%s\n" _