Shell getopts

#!/bin/ksh env=
mailto=
start_step=
single_step=
echo_only=
while getopts e:m:s:pn OPTS
do
    case ${OPTS} in
        e) export env=${OPTARG};;
        m) export mailto=${OPTARG};;
        s) export start_step=${OPTARG};;
        p) export single_step=true;;
        n) export echo_only=true;;
    esac
done
相關文章
相關標籤/搜索