代码如下:

#! /bin/bash
while getopts a:bc opt
do
case $opt in
a)
echo "aaa"
echo $OPTARG

b)
echo "bb"

c)
echo "ccc"

*)
echo "error"

esac
done