注意事项: $# 表示输入参数的个数. $0 表示文件名 $1 表示输入的第一个参数.
#!/bin/bash
#purpose:to test shell funtion
#date:2015-02-05
#author:lirongqiang
function sayHello(){
echo "my first function"
return 0;
}
sayHello;
result=$?;
echo $result;
if [ $result = 0 ];then
echo "function has been executed successfully"
else
echo "error"
fi
<script type="text/javascript" id="wumiiRelatedItems"> </script>