Describe the problem
I have seen on some Mac systems that the color output looks very wonky with escape codes not treated properly with echo.
Furthermore, the -e and -n flags to echo are not implemented in all versions of echo.
Suggested Fix
Use tput to gather the binary representation of the color change rather than an escape code that needs to be interpreted.
For the second thing with those flags for echo not being implemented, I suggest using the printf command.
Alternative approaches:
You could probably do something tricky, or some python library. I don't think these approaches will be simpler than the suggested approach.
Bug Report
Describe the problem I have seen on some Mac systems that the color output looks very wonky with escape codes not treated properly with
echo
.Furthermore, the
-e
and-n
flags toecho
are not implemented in all versions ofecho
.Suggested Fix Use
tput
to gather the binary representation of the color change rather than an escape code that needs to be interpreted.For the second thing with those flags for echo not being implemented, I suggest using the
printf
command.Alternative approaches: You could probably do something tricky, or some python library. I don't think these approaches will be simpler than the suggested approach.