[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mv yy/c zz/c /somedir
From: |
Jim Meyering |
Subject: |
Re: mv yy/c zz/c /somedir |
Date: |
Fri, 21 Sep 2001 16:12:11 +0200 |
User-agent: |
Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.0.106 |
Dan Jacobson <address@hidden> wrote:
> Fellas, should we feel bad about
> $ mv yy/c zz/c /somedir
Yes.
> yes, the usual alias mv=mv -i will protect the general user, and I
> suppose for scripts the user is supposed to know better...
>
> so i suppose no child-guard protection cap is needed, however maybe
> mention this hazard on the info page.
>
> this probably would occur with typings like
> $ mv */*c* /somedir
Thanks for reporting that.
I think I have found a way to make GNU mv fail in that case --
with minimal performance impact.
cp should at least warn, too, in case someone does `cp some... files... dir'
and then upon successful completion runs `rm -rf some... files...'.
BTW, if you use mv's --backup=numbered option when running
that command, you wouldn't lose any data.