Bug 1882695 - Manpage of find is incomplete regarding printf options
Summary: Manpage of find is incomplete regarding printf options
Keywords:
Status: POST
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: findutils
Version: 8.2
Hardware: All
OS: Linux
unspecified
low
Target Milestone: rc
: 8.0
Assignee: Lukáš Zaoral
QA Contact: Radka Brychtova
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-25 11:01 UTC by Steffen Froemer
Modified: 2023-08-21 12:02 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Gitlab redhat/centos-stream/rpms findutils merge_requests 7 0 None opened improve description of printf options in find manpage 2023-08-21 12:02:04 UTC

Description Steffen Froemer 2020-09-25 11:01:04 UTC
Description of problem:
The list of possible option for printf format of File access time isn't complete regarding strftime options.

Version-Release number of selected component (if applicable):
findutils-4.6.0-20.el8.x86_64

How reproducible:
100%

Steps to Reproduce:
1. `man find`
2. search for %AF in printf section
3.

Actual results:
The option is not listed

   737         -printf format
…
  776                %Ak    File's last access time in the  format  specified  by  k,  which  is
   777                       either `@' or a directive for the C `strftime' function.  The possi‐
   778                       ble values for k are listed below; some of them might not be  avail‐
   779                       able  on  all systems, due to differences in `strftime' between sys‐
   780                       tems.
...
815                       Date fields:
   816
   817                       a      locale's abbreviated weekday name (Sun..Sat)
   818
   819                       A      locale's  full  weekday name, variable length (Sunday..Satur‐
   820                              day)
   821
   822                       b      locale's abbreviated month name (Jan..Dec)
   823
   824                       B      locale's full month name, variable length (January..December)
   825
   826                       c      locale's date and time (Sat Nov 04 12:02:33 EST  1989).   The
   827                              format is the same as for ctime(3) and so to preserve compat‐
   828                              ibility with that format, there is no fractional part in  the
   829                              seconds field.
   830
   831                       d      day of month (01..31)
   832
   833                       D      date (mm/dd/yy)
   834
====>  HERE "F" is missing
   835                       h      same as b
   836

Expected results:
Either the complete list of strftime options or limited list with redirect to strftime.

Additional info:
https://man7.org/linux/man-pages/man3/strftime.3.html

Comment 2 Kamil Dudka 2020-10-02 08:39:36 UTC
(In reply to Steffen Froemer from comment #0)
>    737         -printf format
> …
>   776                %Ak    File's last access time in the  format specified  by  k,  which  is
>    777                       either `@' or a directive for the C `strftime' function.  The possi‐
>    778                       ble values for k are listed below; some of them might not be  avail‐
>    779                       able  on  all systems, due to differences in `strftime' between sys‐
>    780                       tems.

The above text already refers to the `strftime` function.

Are you proposing to change wording of the text somehow?

Comment 3 Steffen Froemer 2020-10-06 11:27:43 UTC
(In reply to Kamil Dudka from comment #2)

> Are you proposing to change wording of the text somehow?

Yes, I would change the wording. The text says:
 
 > The possible values for k are listed below; some of them might not be  available  on  all systems, due to differences in `strftime' between systems.

This means, the parameters listed in the manpage of `find` are the only ones which are supported out of the whole list of available parameters in strftime. This is wrong.
Better to say, "Below is an excerpt of possible values for k. For full list please refer to documentation of `strftime`*

*typically I guess the manpage of strftime on different systems does only consist the list of supported values, so an exception of unsupported values can be left out.

Does this make sense?

Comment 4 Kamil Dudka 2020-10-06 15:17:10 UTC
Thanks!  I have proposed a patch upstream:

https://lists.gnu.org/archive/html/bug-findutils/2020-10/msg00000.html

Comment 5 Kamil Dudka 2020-10-07 11:09:41 UTC
upstream commit: https://git.savannah.gnu.org/cgit/findutils.git/commit/?id=efa4554930


Note You need to log in before you can comment on or make changes to this bug.