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/bash 行,但无法工作
还有其他方法吗?
不可以。终端不设计为水平滚动。用于less -S允许左右滚动以及上下滚动。
less -S
也许您应该考虑使用dialog,这是对话框的手册页,或者ncurses为您执行此操作,而不是与输出文本和滚动的方式搏斗。让这些库为您处理。
希望这会有所帮助,最好的问候,汤姆。