I have some color codes in my ~/.bashrc
:
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking
export LESS_TERMCAP_md=$'\E[01;38;5;74m' # begin bold
export LESS_TERMCAP_me=$'\E[0m' # end mode
This adds some color to my man pages. However, when I use env
, bash still interprets the color codes:
$ env | grep LESS
LESS_TERMCAP_mb=
LESS_TERMCAP_md=
LESS_TERMCAP_me=
Screenshot:
How can I escape these strings so I can see them as string literals? Ideally something like env | escape_color_codes_somehow
.
cat -e
(depending on your implementation ofcat
) will display a printable ASCII representation of otherwise unprintable characters.