bug-findutils
[Top][All Lists]
Advanced

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

[bug #15036] find's %M format arg is undocumented


From: Lenny Foner
Subject: [bug #15036] find's %M format arg is undocumented
Date: Tue, 22 Nov 2005 20:37:17 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Firefox/1.0.7 (Ubuntu package 1.0.7)

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/





reply via email to

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