如何在 bash 脚本中创建使用箭头进行导航的界面?
我一直在使用一堆脚本,并且厌倦了总是在终端中输入命令,所以我想编写某种用户界面。想想像“aptitude”这样的东西,通过像“top”这样的循环进行实时更新。它是一个 VPS,所以我无法以图形方式进行操作。
我需要的只是简单的菜单,用箭头等在项目之间移动。有没有好的教程,是否可以使用 bash?
提前感谢您的宝贵时间。
I am using bunch of scripts all the time and I'm getting tired of always typing the commands in terminal, so I would want to write some sort of user interface. Think of something like "aptitude" with live updates through a loop something like "top". It is a VPS so I cant do it graphical.
All I need is simple menus, moving between items with arrows and such. Is there a good tutorial, is it even possible with bash?
Thanks in advance for your time.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 dialog 命令。它允许您创建可以处理键盘(甚至鼠标)输入的可视化 UI 小部件。
您可以选择创建输入框、菜单、文本框、复选框等。
想象一下类似
mc
的界面,尽管mc
本身比这要多一点。Have a look at the dialog command. It allows you to create visual UI widgets that can handle keyboard (and even mouse) input.
You have options for creating input boxes, menus, text boxes, check boxes and many others.
Think of a
mc
- like interface, althoughmc
itself is a little more than this.这并不完全正确。您听说过远程桌面技术吗?例如,X2Go。
诚然,许多图形应用程序和桌面环境可能过于重量级,无法在小型 VPS 中舒适地运行。但至少理论上是可能的。
Not strictly true. Have you ever heard of remote desktop technology? For example, X2Go.
Admittedly, many graphical apps and desktop environments might be too heavyweight to run comfortably in a small VPS. But it is theoretically possible at least.