[UPHPU] bash colors

Richard K Miller richardkmiller at gmail.com
Thu Aug 21 14:19:27 MDT 2008


Using the echo "-e" flag causes color codes to be interpreted:

echo -e "\e[0;31mThis is red\e[0m"

echo "\e[0;31mThis is not red\e[0m"


Is there a way to do this with sed?

| sed -E "s/(something_to_highlight)/\e[0;31m\1\e[0m/g"


Richard






More information about the UPHPU mailing list