-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Bob Proulx on 6/17/2009 11:12 AM: > If there are three program arguments then the last one must be a > directory or it is an error. But with only two it isn't possible to > determine the caller's intention.
It is also possible to write shell functions or aliases so that you can avoid some of these mistakes. For example: $ alias safe_copy='cp -n' $ safe_copy file*.txt when given only two file names from the glob will be a silent no-op rather than overwriting the second file with contents from the first, but can still be overridden when you mean for the overwrite to happen: $ safe_copy -i file*.txt cp: overwrite `file1.txt'? y On the other hand, I just noticed that with -v, there is nothing output to make it obvious when a copy was omitted because -n took effect; maybe it would make sense for 'cp -vn' to be verbose about files that it refused to copy because it would have clobbered a destination? - -- Don't work too hard, make some time for fun as well! Eric Blake e...@byu.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAko5OWAACgkQ84KuGfSFAYAWVwCfWwz1qyfnaEjDdlGpN/aYslrD B7IAoL2kTuWazBVaaG8gRoDKF5m1gvx7 =3Vzm -----END PGP SIGNATURE----- _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils