Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: add an mv protection ?



Marc Chantreux <marc.chantreux@xxxxxxxxxxxxxxxxxx>:
> % echo *
> a.pl b.pl
> % mkdir old
> % mv *pl
> 
> Here, i forget the target ( old ). The result is :
> mv a.pl b.pl
> i've lost the b.pl content!
> is there a way to hook this case and ask a confirmation ?

Hi Marc,

% man mv
[snip]
       -i, --interactive
              prompt before overwrite
[snap]

I don't know, if it's possible to check if an overwrite is intended or
not. So, if you really need it, I'd use "alias mv='mv -i'".

Regards, Frank



Messages sorted by: Reverse Date, Date, Thread, Author