[Top][All Lists]

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

Re: cp/mv: add -n option to not overwrite target (Ubuntu bug #229182)

From: Eric Blake
Subject: Re: cp/mv: add -n option to not overwrite target (Ubuntu bug #229182)
Date: Mon, 22 Dec 2008 07:31:43 -0800 (PST)

> > cp [-Pfip] source_file target_file
> Thanks for the clarification. So POSIX mandates all of -fin are allowed,
> the last taking precedence. I presume it also means warnings should not be
> printed.

No, POSIX only mandates -fi.  -n is an extension, so we can make it
behave however we'd like (although consistent behavior goes a long way).

> In any case I think the `mv` descriptions should we reworded to something
> like:
> -f    rename a file even if the destination is present and not writable
>       (overrides any previous -i or -n option).

Not quite.  -f and -i do not override each other.  Per POSIX, they
affect independent code paths, such that:

cp -f
cp -i
cp -f -i (also spelled cp -i -f)

have four different behaviors.

Eric Blake

View this message in context: 
Sent from the Gnu - Coreutils - Discuss mailing list archive at Nabble.com.

reply via email to

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