Saturday, April 9, 2022

[SOLVED] Ignoring escape sequences and other characters in UNIX redirection

Issue

I'm redirecting console output to a file, and getting [?25h and [?25l mixed in with my regular output. I've looked online and href="http://tldp.org/LDP/abs/abs-guide.pdf" rel="nofollow">apparently they are the sequence characters for cnorm and civis, whatever those are. Is there any way to suppress these in the output?


Solution

I ended up piping through sed. Jim's info is still very helpful, though. I used this command:

sed 's/\[?25[hl]//'

Incidentally, it catches [?25h and [?25l, but not when they're in succession ([?25h[?25l). Any suggestions for that?



Answered By - Apophenia Overload
Answer Checked By - Dawn Plyler (WPSolving Volunteer)