That would seem like an easy option to do - is there a reason other
than convention that it doesn't exist?
I also don't allow mv or cp to overwrite the targets - the need to do so
is only a small percentage of copy or move operations - in those cases, I
simply use /bin/cp or /bin/mv.
(I suspect that frustrations caused by those two commands overwriting
targets contributes to a large extent the bad associations many users have
with unix)
But it's not very effective to make a similar script for scp.
Well, I'm not answering your question as I am not experienced enough
to do so, but instead of using /bin/mv and /bin/cp can't you just use
the "-f" option: mv -f cp-f. The man pages say that it means force
and as a result these commands don't prompt for overwrite. However, I
think that scp can't do this because it can't "list" the target
directory so it cannot know if the files already exist. That's my
guess...
If you want handholding, you're in the wrong place. *nix tends to
assume you know what you're doing, so like a good bird dog, does what
it's been told to do. There's plenty of ways to manage this,
including simply listing the remote dir prior to copying.
Alternatively, instead of clobbering an existing file, why not copy to
a date-stamped version of the file?
cp blah $(date '+%Y%M%d')_blah # or `date '+%Y%M%d'`
--
Any technology distinguishable from magic is insufficiently advanced.
(*) Linux Counter #80292
- - http://www.faqs.org/rfcs/rfc1855.html Please, don't Cc: me.
Of course it can list the target directory. It just needs to do an
access(2) first - if it chooses to carry the Protocol Information across
to the peer.