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:
- https://unix.stackexchange.com/questions/14684/removing-control-chars-including-console-codes-colours-from-script-output
- http://www.commandlinefu.com/commands/view/3584/remove-color-codes-special-characters-with-sed
- and
-no-ansi
pointed out jens in other answer
edit
this command job pretty well:
sed -r "s/\x1b\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|k]//g"
Comments
Post a Comment