how to avoid ESC sequence 

Newsgroups: comp.unix.shell

*Tags*: avoid ESC sequence characters, control characters

> When using the bash interactively, my directory listing shows up
> nicely in colors. I know it is done using ESC sequences. But when I
> use typescript to record the history, I don't want those ESC
> sequences show up in the script file.
> I tried to set TERM=vt100 and clear TERMINFO but it doesn't help.

That's a bug-by-design in color ls. It's hardcoded to use the output of dircolors, which makes a table (usually the environment variable $LS_COLORS) telling which terminal types do ANSI color. The simplest way to disable it is to unsetenv LS_COLORS.

Thomas E. Dickey

how to avoid ESC sequence 

unalias ls

Cyrille.

how to avoid ESC sequence 

This works:

TERM=
TERMINFO=

Tong