bug-coreutils
[Top][All Lists]
Advanced

[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:16:03 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.18) Gecko/20081105 Thunderbird/2.0.0.18 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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
cp [-Pfip] source_file... target
cp -R [-H|-L|-P] [-fip] source_file... target

By convention, options that are mutually exclusive are called out with
separator bars, all other options may be specified simultaneously.
http://www.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html#tag_12_01
Therefore, POSIX requires support for 'cp -i -f' and 'cp -f -i', but
leaves behavior unspecified for 'cp -H' (the only POSIX use of -H requires
- -R; we silently ignore it when -R is omitted, but are allowed to issue an
error) and 'cp -R -H -L' (-H and -L are mutually exclusive; we silently
accept the last of the conflicting options, but are allowed to issue an
error).

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAklPoSMACgkQ84KuGfSFAYBcYwCgvNFOn5YQ0KztWHnfVVpzPTt+
V+kAoMaaB7Fpub7tzH6gqlwOsIUSWgpB
=Rb4W
-----END PGP SIGNATURE-----




reply via email to

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