I have a bash script on CentOS 7.4 with the following line that lets a user input a variable and then lets them confirm that what they entered is indeed correct:
read -p "Enter the name of the database: " dbname
echo "You entered: $dbname"
read -p "Is that correct? Enter y or n: " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1
When I SSH into the CentOS machine from Windows 10 with the Command Prompt app to run the script, sometimes I mistype a letter when inputting the variable and I need to backspace. However, when I try to backspace, the Command Prompt app just types out ^H
.
How can I either modify my script or modify a setting somewhere in CentOS or Windows so that my backspace in this setup will actually be functional?
Turns out that Windows Command Prompt is just a bit wacky. Using PuTTY to SSH into the CentOS box, I can backspace for the read
prompt without any issues.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments