首页 > 代码库 > shell脚本 传参数 case for

shell脚本 传参数 case for

$ cat openstack_install.sh #!/usr/bin/env bashfunction usage {  echo "Usage:$0 [OPTAION]..."  echo "master      install openstack master in this system."  echo "compute     install openstack compute in this system."  exit}function process_option {  case "$1" in      -h|--help) usage ;;      master) libary="keystone nova ceilometer horizon" ;;      compute) libary="nova ceilometer" ;;      *) usage  esac}for arg in "$@"; do  process_option $argdonefor lib in $libary; do  echo $libdone

 

shell脚本 传参数 case for