You are not logged in.
Hi,
If I direct the output of 'ls' to a file like:
ls > file.txt
and open the file in a editor such as vi, joe or mousepad, it looks like this:
[[01;34m22x22[[0m
[[01;34m24x24[[0m
[[01;34m32x32[[0m
[[0mindex.theme[[0m
[[01;34mscalable[[0m
[[m
I just did the same thing on an old slackware box and no control characters are visible. The same for a recent LFS build. I realize I could probably pipe through dos2unix, but it shouldn't be happening anyway. Any input is appreciated.
Thanks
-Frank
Last edited by fianella (2007-10-24 10:37:00)
Offline
at the DOS prompt (sorry, old habits die hard :-) ) type
alias ls
and see what the results are. Compare that against your slackware or lfs builds. You will probably find that the color= option is different - most builds will not include the color ANSI sequences if you pipe the output, but if it says color=always the color codes will be included in the redirected file.
Assuming you find an alias for ls that forces color output, you need to find where that is taking place... in your ~/.bashrc file? in /etc/profile.d? And change that to alias ls='ls --color=tty' or something sensible like that.
Peter B. Steiger
Cheyenne, WY
Offline
Actually, the output of 'alias ls' is the same on both the Arch & Slack boxes:
'ls --color=yes'
I unaliased ls and reset it to alias ls='ls --color=tty' as you had suggested and the problem disappeared.
Many thanks for your help!
-Frank
Offline
Try out an "\ls" as well. It's the same as a /bin/ls, i.e. ignoring all aliases.
Offline