我需要以下示例bash脚本来表现如下:
echo -e "Enter name: \c" read U_IP_NAME echo -e "You said your name is : $U_IP_NAME"
这将输出到:
Enter name: Alok You said your name is : Alok
但是我想要它是:
You said your name is : Alok
有办法实现吗?
[解决方案由:mouviciel]
你想将光标向上移动一行.这是通过tput cuu1实现的:
原文链接:https://www.f2er.com/bash/383927.htmlecho -e "Enter name: \c" read U_IP_NAME tput cuu1 echo -e "Your said your name is : $U_IP_NAME"
更多信息与man tput和man terminfo.