URL:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=15036>
Summary: find's %M format arg is undocumented
Project: findutils
Submitted by: foner
Submitted on: Tue 11/22/05 at 20:37
Category: find
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Release: 4.2.26
Fixed Release: None
_______________________________________________________
Details:
When using find -printf, the %M format arg (which prints mode information in
symbolic form) is completely undocumented, both in the manpage and in the
Info nodes. I guessed that it might be there by analogy with %g/%G and
%u/%U, and I'm very glad it was, because a script I was using would have had
to have been rewritten if it wasn't. But it should be documented in both
places. Thanks! (Later versions of the Info mention %M when talking about
escaping unusual characters, but don't actually mention it where it might
actually be invoked, namely on the page talking about %u/%U etc.)
(I was doing this in the first place because I was trying to emulate find -ls
but with owner/group written numerically; this is essential when trying to
compare output across machines which map uid/gid differently. It would be
really, really nice if -ls had some sort of modifier that made it possible to
get this information in numeric form, without having to hand-craft a format
string; I note that such hand-crafting might even be impossible, since it's
not clear to me how to get file-time outputs that are identical with -ls's
behavior given the format directives available---%t adds day-of-week and
seconds, while %T and various modifiers don't appear to make it possible to
switch formats between month-day-hour and month-day-year depending on the age
of the file as -ls and the ls program do. To really do this transparently
might require invoking find -twice-, using two different format strings and
filtering based on the files' ages. Yucko. Yet it would obviously be a
trivial change to the -ls logic, assuming some agreement over how to name the
option that invokes it, or a new directive could be added for printf so that
it's possible to exactly emulate -ls -or- to tweak certain fields as I had to
do. I'll refile this paragraph as a feature request as well so these can be
independently tracked.)
_______________________________________________________
Carbon-Copy List:
CC Address | Comment
------------------------------------+-----------------------------
foner |
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=15036>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
_______________________________________________
Bug-findutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-findutils