bug-coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH]: ls: add --user-format option for user defined format


From: Bob Proulx
Subject: Re: [PATCH]: ls: add --user-format option for user defined format
Date: Sun, 23 Nov 2008 18:10:43 -0700
User-agent: Mutt/1.5.13 (2006-08-11)

Jim Meyering wrote:
> Ondřej Vašík wrote:
> > Pádraig Brady wrote:
> >> Ondřej Vašík wrote:
> >> > Let's do some summary, feel free to add/comment items if you have
> >> > something not mentioned here:
> >> >
> >> > What patched ls --user-format can and upstream find -printf not:

I am probably missing the finer details of 'find -printf' but I don't
see an easy way to use find to replicate 'ls -logF' for example.  It
is really only a superset if it can replicate all of the existing
behaviors.

> >> As I see it ls output is tuned for human consumption,
> >> while find is tuned for further consumption by other scripts/utils.

That is the way I think about it too.

> Here are my questions:
>   - is it worthwhile to add a --printf option to ls?
>       I don't like the --user-format name)

I think it would be useful.  It would make ls more general purpose.

This shouldn't really affect scripts.  Scripts generally don't use
'ls' except for when people have used it when they shouldn't have.
(e.g. A commonly seen bad example: for f in $(ls);do ...)

I think we need to continue to push people to use 'find' for scripts.
Because it isn't being flung from new user's fingers from the command
line as often as 'ls' then they don't think of it when writing a script.
But they should be using 'find' more because it is often the right tool
for the task.

>   - if so, should it use use a find -printf-compatible format string
>       or one compatible to stat --printf?  Either way, it'll need a few
>       extensions.

I don't think it is possible for it to be 100% compatible with either.
Therefore I don't think it is required that it be 100% compatible.  To
paraphrase another moto, as close as possible but no closer.

Bob




reply via email to

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