`

linux 下的文本”图形”界面工具: dialog

阅读更多
回头来看 Beginning Linux Programming 的 shell 部分还是有不少收获,其中一个 dialog 的工具,就激发了我写个简单的选择 ip 的小脚本的想法: 把 ip 分类保存成文件,每个文件中的一行(unix 风格换行符)为一个 ip,然后把下面的脚本的 host_path 值修改成这些 ip 文件所在目录—该目录下不要有其他文件即可。 # list all the host files host_path=/home/hick/hosts/ # compose the menu tag menu_tag='' for file in $(ls $host_path); do menu_tag="$menu_tag $file $file" done # display the host files dialog --title "QzoneCity host list" --menu "please select the type" 30 30 15 $menu_tag [...]
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics