getopt vs getopts
摘要:getopt示例#!/bin/bashaflag=noargs=`getopt a: $@`if [ $? -ne 0 ]; then echo 'Usage: ...' exit 2fiset -- $argswhile [ $# -gt 0 ]do case "$1" in (-a) echo "-a was triggered, Parameter: $OPTARG" >&2;; (--) shift; non_option_arguments=$@; break;; (-*) echo "$0: error
阅读全文
posted @ 2013-09-27 17:18
浙公网安备 33010602011771号