摘要: #!/bin/bashE_PARAM_ERR=198EQUAL=199max2(){if [ -z "$2" ]thenreturn $E_PARAM_ERRfiif [ "$1" -eq "$2" ]thenreturn $EQUALelseif [ "$1" -gt "$2" ]thenreturn $1elsereturn $2fifi}echo "the first number:"rea... 阅读全文
posted @ 2010-05-18 14:09 waynechen 阅读(7170) 评论(0) 推荐(1) 编辑
摘要: #!/bin/bashfunc(){echo "$1"}echo "fist call to function: no arg passed."echo "see if command-line arg is seen."funcechoecho "second call to function: command-line arg passed explicitly."func $1exit 0#... 阅读全文
posted @ 2010-05-18 10:52 waynechen 阅读(364) 评论(0) 推荐(0) 编辑