I have written a bash script that looks like this which basically handles user operation based on selection.
PS3='Please enter current status of the completion: '
boolean_status=("completed" "not-yet")
select opt in "${boolean_status[@]}"
do
if [ "$REPLY" -ge 1 -a "$REPLY" -le 2 ]; then
n=$opt
break;
fi
done
But I am facing a problem with this code snippet the input of this code accepts backspace as ^H
and up as [[A^
etc. I want my user to use up and down arrows freely without these symbols popping up. Is there a way to resolve this issue.
Like in the read
command we have -e
option that neglects all these characters what is it's equivalent in select??