[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
cp -f
cp -i
cp -f -i (also spelled cp -i -f)
have four different behaviors.
--
Eric Blake
--
View this message in context:
http://www.nabble.com/cp-mv%3A-add--n-option-to-not-overwrite-target-%28Ubuntu-bug--229182%29-tp19990260p21129699.html
Sent from the Gnu - Coreutils - Discuss mailing list archive at Nabble.com.