corrupted redirect
I do a long listing on a directory, pipe it to awk '{print $11}' and I see something similar to this;
Quote:
Quote:
Quote:
|
If using `ls` to do the listing, try:
Code:
ls --color=never Code:
/bin/ls The garbage you see are color escape codes, for colorizing the output in your terminal. This is often set up by making `ls` an alias to `ls --color=something`, in either /etc/profile or ~/.profile or ~/.bash_profile or one of the other similar profile files. Here's an example from my machine, where my `ls` command is aliased: Code:
sasha@reactor: alias |
GrapefruiTgirl, I think you're on to something. If I unalias ls prior to generating the file then the escape sequences are not there.
Should this be classified as a bug in ls? |
No, it's not a bug. It's a feature! :) It's an option of `ls` that's being put to use, probably set up by you (perhaps unknowingly) or your OS by default, or by your sysadmin if that's not you. Your OS wants you to have colored ls.
Read the `ls` man page, and the `bash` man page to read about aliases (or whatever shell you use, if not bash). Comment out the entry in the .profile or /etc/profile or whatever file it is, where the alias is set, if you prefer not to have it turned on. |
Quote:
Quote:
|
Quote:
|
Nice going ;) now you can mark this [SOLVED] if you're satisfied, using the Thread Tools menu near the top.
Cheers! |
All times are GMT -5. The time now is 02:49 AM. |