function prin(){ <=====这 是 一个 函?
9 echo -n "You write is"
10 }
11 case $1 in
12 "one")
13 prin();echo $1 | tr "[a-z]" "[A-Z]"
14 ;;
15 "two")
16 prin();echo $1 | tr "[a-z]" "[A-Z]"
17 ;;
18 "three")
19 prin();echo $1 | tr "[a-z]" "[A-Z]"
20 ;;
21 *)
22 echo "You should input one of fllowing parameters:one,two or three"
23 exit 1
执行 结果:
sh13.sh: line 16: 在未预料的“;”附近出现语法错误
sh13.sh: line 16: ` prin();echo $1 | tr "[a-z]" "[A-Z]"'
错 在 哪里 啊 ???
gwssgc 于 2011-10-02 10:27:01发表:
同上
相思爱文 于 2011-10-01 20:04:18发表:
引用函数时只写名,别加()
12 "one")
13 prin;echo $1 | tr "[a-z]" "[A-Z]"
14 ;;
15 "two")
16 prin;echo $1 | tr "[a-z]" "[A-Z]"
17 ;;
18 "three")
19 prin;echo $1 | tr "[a-z]" "[A-Z]"