I'm trying to ask for user invention in color without having the answer in a separate line.
I currently have this:
msg() {
local mesg=$1; shift
printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n"
}
ALL_OFF="$(tput sgr0)"
BOLD="$(tput bold)"
GREEN="${BOLD}$(tput setaf 2)"
[...]
until [[ $REPLY = [yY] ]]; do
msg "Done (y/n)?" && read -p ""
done
But as mentioned, the problem is it puts the response to a new line:
==> Done (y/n)?
y
So how can I not do that?
Also is there any way to have the response in color as well?