1 #!/bin/bash
2
3 function help(){
4 echo "this is help cmd!"
5 }
6 function close(){
7 echo "this is close cmd!"
8 }
9
10 case $1 in
11 "-h")
12 help //调用时不需要加括号
13 ;; //结束该代码段
14 "-c")
15 close
16 ;;
17
18 esac
Linux shell脚本函数function fname(){ //函数代码段}
最新推荐文章于 2024-05-20 09:41:32 发布