When I run a simple shell script with the following code:
printf "\e[32m Hello World\n"
\e[32m Hello World
as output as opposed to a green Hello World output.
printf doesn't understand \e; you need to use \033. Note that printf is also a bash builtin; that one has GNU extensions including \e, but unless you specifically request your script be run by /bin/bash you will usually get the POSIX one.
Sign up using Google
Sign up using Facebook
Sign up using Stack Exchange
3 years ago