NetBSD-Bugs archive

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

Re: bin/57434: cp(1) -P description is misleading.



At Wed, 24 May 2023 13:45:02 +0000 (UTC),
Robert Elz wrote:
>    | When I see syntax in SYNOPSIS section, I can understand that -P should
>    | be specified with -R.
>  
>  Actually, no, -P and -R aren't (quite) that closely related.  However -P
>  is related to -H and -L (at most 1 of those three can be set) and -H and -L
>  only apply when -R is set.   It is all very murky...

Indeed..
Anyway, why I thought that -P should be specified with -R is the
following notation in the SYNOPSIS section:

  SYNOPSIS
     cp [-R [-H | -L | -P]] ...

I read it as "When you specify -R, you can also specify probably one of
-H, -L, or -P at the same time", in other words, "(one of -H, -L, or) -P
can only be specified with -R".
If no (in fact, -P can be specified without -R), I feel this bracket
notation makes confusing...

>    | However, -P can be specified without -R.  I don't know what is correct
>    | (intended) situation, but the followings are that I observed:
>  
>  I believe your observations are correct.

Thanks.  Then, how about this?

  -P  No symbolic links are followed.
-     This is the default.
+     The -R option implies the -P.

>  However (unsuprisingly) you
>  didn't test the (rather older) -r option - when that's set -P is (more or
>  less) set as well (it is, but it isn't....)

Thank you for pointing out, but I don't worry about -r this time.
-r option is not listed in the DESCRIPTION section and is explained
carefully in the COMPATIBILITY section.  The manpage suggests that
cp -r may not handle symlinks and etc. expectedly.
---
Tetsuya Isaki <isaki%pastel-flower.jp@localhost / isaki%NetBSD.org@localhost>


Home | Main Index | Thread Index | Old Index