赞
踩
#!/bin/bash
# handle the command's parameters
# shell's name is test
cli="test"
while [ $# -gt 0 ] # $# means the number of the parameters and $* means the parameter's string
do
case $1 in # $1 means the first parameter
-f)
cli=$cli" -f "
shift # shift means remove the leftmost parameter
cli=$cli"$1"
shift
;;
-d)
cli=$cli" -d "
shift
cli=$cli"$1"
shift
;;
esac
done
echo $cli
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。