Subject: way to restore 'ls' formatting after pipe
To: None <netbsd-help@NetBSD.org>
From: Henry Nelson <netb@yuba.ne.jp>
List: netbsd-help
Date: 11/04/2006 09:54:10
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?
If it's not clear what I mean, ls gives an output in columns like:
% /bin/ls
togawa.doc ?v?Z????.?? ????????.PCX ?v?|
youshi.txt ?????t??.?[ ???_?f?[.?^
, but after passing it through the charset conversion the files are
listed on individual lines:
% /bin/ls | iconv -f sjis -t euc-jp
togawa.doc
youshi.txt
JAPANESE.MM
MULTIBYTE.XX
CHARACTERS.PCX
LEGIBLE.ZZ
HERE
Any help/ideas much appreciated.
--
henry nelson