sed - How to remove the decorate colors characters in bash output? -


a console program (translate-shell) has output colors , uses special decorate characters this: ^[[22m, ^[[24m, ^[[1m... , on.

i'd remove them plain text.

i tried tr -d "^[[22m" , sed 's/[\^[[22m]//g', removed number, not special character ^[

thanks.

you have multiple options:

edit

this command job pretty well:

sed -r "s/\x1b\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|k]//g" 

Comments

Popular posts from this blog

ios - Is 'init' forbidden as *part* of a variable name? -

c# - Get the Class name in a class with atribute inside a attribute method -

file - Python: AttributeError: 'str' object has no attribute 'readlines' -