首页 > shell下如何确定输入为backspace

shell下如何确定输入为backspace

看下面的代码

stty cbreak -echo  
input==`dd if=/dev/tty bs=1 count=1 2>/dev/null`  
stty -cbreak echo  
if [ "$input" = "a" ];then
    echo "输入的是a"
fi

我如何确定输入的是退格键(backspace)呢,也就是说backspace的标志是什么?


if [ "$input" = $(echo -ne '\b') ];then
【热门文章】
【热门文章】