shell 中select 的用法

shell中的select用法  分享 shell select也是循环的一种,它比较适合用在用户选择的状况下。 好比,咱们有一个这样的需求,运行脚本后,让用户去选择数字,选择1,会运行w命令,选择2运行top命令,选择3运行free命令,选择4退出。脚本这样实现:bash #!/bin/bash echo "Please chose a number, 1: run w, 2: run top,
相关文章
相关标签/搜索