I am running linux on hardware without screen and dumping all the data onto serial. I am reading linux serial out through applications like hyperterm or teraterm. I get properly formatted output for serial. However, if I dump that output to a file and then try to read it then I see lot of extra characters. Mostly they must be flow control characters from tty core. Is there any way to disable these flow control characters coming from tty core. This is how my ls command looks:
# ls
[0;0m1q[0m [1;34mbin[0m [1;34mhome[0m [1;34mmnt[0m [1;34msbin[0m [1;34mvar[0m [1;34mdev[0m [1;32minit[0m [1;34mopt[0m [1;34msys[0m [1;34metc[0m [1;34mlib[0m [1;34mproc[0m [1;34mtmp[0m [1;36mlinuxrc[0m [1;34mroot[0m [1;34musr[0m
Thanks.
These aren't flow control characters, they're attribute setting control characters (specifically color setting) for xterms or other color ansi-compatable terminal device. To get rid of them, turn off auto-colorization in ls and other commands, or set the TERM envvar to something that doesn't understand color (or any other) control. TERM=dumb
should do the trick.