bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Canceling interactive mode - cp


From: Brian Dessent
Subject: Re: Canceling interactive mode - cp
Date: Sun, 23 Dec 2007 23:00:32 -0800

August Zajonc wrote:

> I'm used to be able to do something like this
> 
> alias cp=cp -i

I think the common opinion around here is that -i aliases like that are
evil and wrong.  They encourage bad behavior like training your muscle
memory to always reply "y" without thinking (thus defeating the whole
purpose of the prompt), and can get you in trouble when you use a
standard system that has no such crutches.

> then when I need to overwrite a file on the destination of a copy, I
> usually do -bf
> 
> This makes a backup but avoids the prompt, perfect for bash scripts and
> similiar.
> 
> Recently I've noticed that I can't cancel -i. There seems to be NO
> command to reverse the -i.

-f is not supposed to cancel -i, by design.

> What's the suggested workaround in these situations. This seems like it
> would be a pretty common approach, and given the somewhat more esoteric
> options, it's odd that one can't reverse or cancel the effect of -i.

The behavior is required by the standards:
<http://lists.gnu.org/archive/html/bug-coreutils/2007-03/msg00093.html>.

The suggested approach is to invoke the non-aliased version of the
command:
<http://lists.gnu.org/archive/html/bug-coreutils/2007-03/msg00099.html>
(or better, not have any troublesome aliases in the first place, but
obviously people are free to do whatever works best for them.)

Brian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]