I often use something like read -e -p "> All good ? (y/n)" -n 1 confirm;
to ask a confirm to the user.
I'm looking for a way to colorize the output, as the command echo -e
does :
echo -e "33[31m";
echo "Foobar"; // will be displayed in red
echo -e "33[00m";
I'm using xterm.
In man echo
, it says :
-e enable interpretation of backslash escapes
Is there a way to do the same thing with the read
command ? (nothing in the man page :( -r
option doesn't work)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…