Is there a way to do `mv`, in either linux or Perl, that will fail if I try to copy a file over another file?
In the mv manpage, I find a `-n` or `--no-clobber` option which does indeed refuse to replace file A with file B. But it is a silent failure. $? is 0 after I run an unsuccessful `mv -n`.
@mcc
Update to (at least) coreutils 9.2, or use a distro which provides that.
With that version, mv -n will print an error and return 1 if a file is skipped. (Previously, it just printed nothing to indicate it was doing nothing. Insert Drake meme here.)