Re: way to restore 'ls' formatting after pipe

"James K. Lowden" <[email protected]>
Newsgroups gmane.os.netbsd.help
Message-ID <[email protected]>
Peter Seebach wrote:
> In message <[email protected]>, 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.