bug-findutils
[Top][All Lists]
Advanced

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

[bug #15037] [Wishlist] find -ls isn't flexible enough but can't be emul


From: Lenny Foner
Subject: [bug #15037] [Wishlist] find -ls isn't flexible enough but can't be emulated via -printf
Date: Tue, 22 Nov 2005 20:51: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=15037>

                 Summary: [Wishlist] find -ls isn't flexible enough but can't
be emulated via -printf
                 Project: findutils
            Submitted by: foner
            Submitted on: Tue 11/22/05 at 20:51
                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:

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.  I needed the output to be in as close to the original
format of -ls as possible, because it was going into scripts that had regexps
carefully crafted to expect this format.  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
(if numeric uid/gid, how about mode? I fear an explosion of modifiers), 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 -think- that
simply emulating the way -ls prints dates might be sufficient, as I believe
that everything else it does can be emulated via other format directives, but
I haven't exhaustively investigated this.

And if another -printf mode is added, the entire thing should be mentioned in
the worked examples, so users know how to do this; presumably it would
approximate the format string I used (but with better date output), which was
roughly -printf "%i %k %M %n %U %G %s %Th %Td %TH:%TM %p\n"

Tnx.



    _______________________________________________________

Carbon-Copy List:

CC Address                          | Comment
------------------------------------+-----------------------------
foner                               | 




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=15037>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

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