tech-userlevel archive

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

Re: Moving rc.d scripts to base.tgz



On Mon, 18 Apr 2011 13:24:13 -0400 (EDT)
der Mouse <mouse%Rodents-Montreal.ORG@localhost> wrote:

> If you can tell me how to make it do so
> and then columnize the result to
> 
>       Makefile      base-1-44.gif.tmp base-2-71.gif  maze2.c
> maze11.c base-1-9.pgm+ base-1-44.pgm     base-2-104.gif maze3.c
> 
> ... I'll be _really_ interested.  If you can
> also make it ignore ls -F decorations, so that "foo foo% foo+" with
> foo executable turns into "foo* foo% foo+" rather than "foo% foo* foo
> +", but if the file is named foo* and is not executable it sorts the
> latter way...
> 
> ...then I'll agree there may be no need for the new code.

Never shy of a challenge, especially when allowed a little handwaving:

        $ ls | foo | xargs ls -dfF

would do what you want.  No, I don't think I could write foo in terms
of sort(1) or even awk(1), and I'm not at all sure ls(1) shouldn't do as
you suggest anyway, always, everywhere.  Who, after all, relies on
lexicographical sorting for the numeric components of a filename?  How
is that helpful (other than easy to code)?  <ducking>

But I know Mouse could write the above foo, and IMO it better fits the
small tool theory.  

I'm just sayin'.[1]

--jkl

[1]
http://www.npr.org/2010/12/18/132160770/its-rude-its-crude-its-stupid-just-sayin
(audio version is better)



Home | Main Index | Thread Index | Old Index