Subject: Re: way to restore 'ls' formatting after pipe
To: None <netbsd-help@NetBSD.org>
From: James K. Lowden <jklowden@schemamania.org>
List: netbsd-help
Date: 11/03/2006 22:14:37
Peter Seebach wrote:
> In message <20061104005410.GA8365@yuba.ne.jp>, Henry Nelson writes:
> >In order to be able to display file names encoded in sjis with ls, I've
> >created an alias: 'ls | iconv -f sjis -t euc-jp'.  This works well
> >enough except that I lose the multi-column output of ls.  Is there some
> >way to re-format the output into columns after the charset conversion?
> 
> Or, look at programs like 'rs'.  (I have one of my own, named 'c', that
> DTRT in nearly all cases.)

Hi Peter, 

I know you weren't looking for suggestions, but I thought I'd make one
anyway. :-)

I think this is a good SoC candidate: a layered filesystem that keeps more
(maybe user-extensible) metadata.  

The simplest idea would be to assign a locale to the whole filesystem,
meaning all filenames would be encoded the same way.  Then, eventually, ls
and friends could be taught to discover the encoding and handle it
appropriately.  

Of course, ls probably needs an encoding option, too.  Looks like -E is
still available.  

I know help@ isn't the best place to make open-ended suggestions, but I
wonder if other people are thinking along the same lines.  

Regards, 

--jkl