作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在努力练习制作一个美观整洁的界面。但是,我被困在这个问题上。我试图强调我设法使用此方法完成的用户的输入
echo -n "Title : "; read -p "$(tput smul)" getTitle; tput rmul
tput smul
用于给单词加下划线,而tput rmul
用于这条语句成功后去除下划线。
不幸的是,当我不小心输入错误并决定退格时,下划线并没有相应消失。
相反,即使我删除了所有用户输入,下划线仍然存在。
有什么解决办法吗?
最佳答案
使用readline
通过 -e
标志:
echo -n "Title : "; read -ep "$(tput smul)" getTitle; tput rmul
关于linux - 退格键不会删除 bash 中 tput 命令的下划线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41940294/
我是一名优秀的程序员,十分优秀!