在shell脚本中用户输入参数使用read命令,但输入过程中操作有误,需要使用退格符来消除错误输入,但输入Backspace会在屏幕上显示^H,可在read命令前添加如下:
#bin/bash
#Type stty erase '^H' before read
stty erase '^H'
read -p "input your name: " name
echo "dage's name:{$name}"
在shell脚本中用户输入参数使用read命令,但输入过程中操作有误,需要使用退格符来消除错误输入,但输入Backspace会在屏幕上显示^H,可在read命令前添加如下:
#bin/bash
#Type stty erase '^H' before read
stty erase '^H'
read -p "input your name: " name
echo "dage's name:{$name}"