シェルスクリプトからgetoptを使う
#! /bin/sh args=`getopt -u -n $0 -l オプション名: '' $*` if [ "$?" -ne 0 ] then usage exit 1 fi set -- $args for i do case "$i" in --オプション名) shift; shift;; --) shift; break;; esac done
#! /bin/sh args=`getopt -u -n $0 -l オプション名: '' $*` if [ "$?" -ne 0 ] then usage exit 1 fi set -- $args for i do case "$i" in --オプション名) shift; shift;; --) shift; break;; esac done