标签:
case的语法结构:
case 待测项 in 样式串1] 命令区域1 ;; (样式串2) 命令区域2 ;; 样式串3) 命令区域3 ;; *) 命令区域 ;; esac
举例:
#!/bin/bash read yname case $yname in Jack | John | Joe) echo ‘Well...‘ echo "Long time no see." echo "How do you do ?" ;; (Mary | Mary) echo ‘Nice to meet you.‘;; C*) echo ‘Long time to see.‘;; *) echo ‘Hi!‘;; esac
标签:
原文地址:http://www.cnblogs.com/52php/p/5669935.html