Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用printf在终端的标准输出中创建一个小动画。到目前为止,我想出了如何用
#!/bin/csh -f printf "text1" printf "text2" sleep 1 printf "\r replaced text2"
如何替换两条线?
printf "\r\r replace text1"
不工作....
您需要使用cuu1terminfo 功能将光标向上移动。
cuu1
printf "foobar" tput cuu1 printf "baz"
伊格纳西奥斯的回答让我走上了正轨!谢谢!!尽管如此:
tput cuu N
将光标向后设置N行。