Hi All,
I am using HP Unix and trying to write a script in menu style. At the end of list, I will accept the input from keyboard and take action accordingly. Uptill here it is ok. However, I want to hide the cursor, display it as blinking line after the prompt. How do I achive it. I am using following command:
tput cup $x $y
printf 'Enter Your Choice : '; read -r opt
In HP Unix, read -p is not recognized.
Thanks
Angshuman
Try:
trap 'stty echo' 0 # This is here in case user breaks out of read with a ctl-C
tput cup $x $y
stty -echo # Turn echoing off.
printf 'Enter Your Choice : '; read -r opt
stty echo # Turn echoing on.
echo # Give feedback that your script read the line typed in.
printf 'Got %s\n' "$opt" # Do whatever else you want with what your read.
Added to Don's if you have the facility...
tput civis # cursor off
tput cnorm # cursor on
setterm -cursor off
setterm -cursor on