copying multiple files

Cathey, Jim jcathey at ciena.com
Tue Nov 22 15:34:51 UTC 2016


>I want to make this the shortest command possible is because I don't want to add 60 lines of code to a script just to copy
>10 files (with error control and so forth).

This sounds like an excellent opportunity to make a function,
or to feed an embedded pipe with a list...

while read f; do
  cp -f $f dest || error oops
done <<EOF
file/path/1
file/path/2
...
EOF

That sort of thing.  There are many ways to skin that kitty.

-- Jim



More information about the busybox mailing list