Ls and cut problem
Hi folks,
Coreutils 5.2.1 from Sarge stable.
ls -alR /home > overview is supposed to yield a neatly tab-delimited output of all columns in file overview, isn't it?
cut --fields=1-5 overview > overview1 should result in only the first 5 columns being written to overview1, isn't it?
Well, it ISN'T.
Whatever I tried with parameters and also piping 'ls' directly to 'cut', I get no desired result. In all cases the output of 'cut' is the complete 'ls'-overview. Only if I add -s to 'cut' I get a different reslult, an output of _exactly_ 0 bytes, hahaha.
Looking with a hexeditor into overview, yes you are right already, does not show one single tab wherever, only spaces to pad for a nice human-reading.
Using in 'cut' --bytes=1-35 (as example) in stead of --fields=1-5 moreoften shows an unusable result (last column cut off or next column already in the picture) as it gives the desired output:
-rw-r--r-- 1 peter peter 82123
drwxr-xr-x 2 peter peter 48 Fe
a) has anyone of you encountered the same problem?
b) has anyone of you maybe a solution to add the tabs in 'ls'? Or is this a more or less severe bug in 'ls'?
Thanks for your help.
|