shell 带参数选择的写法
2019-03-01 本文已影响2人
SkTj
!/bin/bash
echo
while [ -n "1" in
-a) param="1,
2"
echo "2"
shift;;
*) echo "wrong"
break;;
esac
shift
done
echo
while [ -n "1" in
-a) param="1,
2"
echo "2"
shift;;
*) echo "wrong"
break;;
esac
shift
done