[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: Pádraig Brady
Subject: Re: cp/mv: add -n option to not overwrite target (Ubuntu bug #229182)
Date: Mon, 22 Dec 2008 14:59:52 +0000
User-agent: Thunderbird (X11/20071008)

Eric Blake wrote:
> According to Pádraig Brady on 12/22/2008 6:55 AM:
>> Well I wouldn't treat -n differently if one must be able to specify both -f 
>> and -i.
>> But does POSIX really specify that? I can't see it from a quick read.
>> All I can see are a mention of the -HLP options:
> Huh?  http://www.opengroup.org/onlinepubs/9699919799/utilities/mv.html
> only specified -i and -f, and none of -HLP.
> Oh, you were looking at cp.  But still, the synopsis on
> http://www.opengroup.org/onlinepubs/9699919799/utilities/cp.html lists
> three forms:
> 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 
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).
-i    always prompt before overwriting an existing file
      (overrides any previous -f or -n option).
-n    never overwrite an existing file
      (overrides any previous -f or -i option).

And for `cp` s/rename/overwrite/ in the -f description.


reply via email to

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