I often use something like read -e -p \"> All good ? (y/n)\" -n 1 confirm; to ask a confirm to the user.
read -e -p \"> All good ? (y/n)\" -n 1 confirm;
I\'m looking for a way to colorize the outpu
I have another solution that allows you to use variables to change the text's format. I echo -e the the output I want into the -p argument of the read command.
echo -e
-p
read
Here's an example:
RESET="\033[0m" BOLD="\033[1m" YELLOW="\033[38;5;11m" read -p "$(echo -e $BOLD$YELLOW"foo bar "$RESET)" INPUT_VARIABLE