Removing Escape Sequence Characters

Hi All,

I have added the script command to user profile so that to record the on-screen data.But when i i checked the O/P i could see lot of escape sequence is there way to remove it.

Not trivial since an escape sequence contains several characters, most of them printable. It'd be possible to make a monstrous sed statement to recognize all of them, technically, but removing them would make it even less readable since it contains the complete record of their terminal output, keystroke by keystroke. Removing backspaces for instance may turn 'rm filename' into 'rm filmoijoijoename' if someone corrected a lot of typos.

If you just cat or more or less -r it in a terminal, that should present it in a readable manner.

sed 's/^[[^a-zA-Z]\+[a-zA-Z]//g'

Note: ^[ is a literal escape character.