ex-11-07_select.sh

来自「Berkely的学生写的」· Shell 代码 · 共 24 行

SH
24
字号
#!/bin/ksh# Chapter 11 - The select loop# This example demonstrates using the ksh/bash select loop## The function CompConf has been added to demonstrate the# behavior of the loopCompConf() { echo $1 ; }PS3="Please make a selection => " ; export PS3select COMPONENT in comp1 comp2 comp3 all nonedo    case $COMPONENT in        comp1|comp2|comp3) CompConf $COMPONENT ;;        all) CompConf comp1              CompConf comp2             CompConf comp3             ;;        none) break ;;        *) echo "ERROR: Invalid selection, $REPLY." ;;    esacdone

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?