xs@kittenz.org writes:
Richard Kettlewell wrote:
"cp -a" should work fine. Other possible invocations of cp might well cause problems, and AFAIK all the non-GNU versions of cp don't have the feature at all...
they do. SuSv3 has it -- just not as -a, which is a gnu extension. cp -RPp is the SuSv3 and POSIX way.
K3wl.
another way of doing it in a POSIX/SuSv3 environment is using pax. e.g. pax -rw -pe foo* bar* /mnt/root
or if you lack pax, tar -cf - foo | (cd /mnt/root; tar -xf -)
Should be "cd /mnt/root && tar -xf -": if the cd fails, you don't want to do the unpack half. (You probably won't be running with "set -e" in an interactive shell.)