1

I am on iTerm2 on mac, and my shell is Bash. I have the following settings. Bash does not recognize the colorcode and escapes.

$export CLICOLOR=1
$echo $TERM
xterm-256color
$echo -e "\e[31mHello World\e[0m"
\e[31mHello World\e[0m
$

Any suggestions on how do I fix this?

2

1 Answer 1

1

Try using \033 instead of \e:

echo -e "\033[31mHello World\033[0m"

Help from: http://tldp.org/LDP/abs/html/colorizing.html

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .