Somehow I'm not able to
read the trailing
\n sign into the
REPLY variable. Under any circumstances I want to avoid a blank line that results from the
\n being echoed by
echo one in case of another character. Given:
declare -l REPLY read >&2 -r -N 1 -p "Acknowledged? (y):" REPLY if [[ "$REPLY" != $'\n' ]]; then echo >&2 fi
For me a possible workaround is it to make
read to suppress (
-s) echoing the input. But ideally the user should see the single character he input after the prompt.
IFS= read -d'' doesn't get me the
\n character into the variable.