function
test (){echo "abctest"}
test
结果
abctest
zzx@ubuntu:~$ cat te1.sh
#!/bin/bash
fun(){
echo nihao
echo $1 $2
return $(($1+$2))
}
fun 11 2
echo $?
total=$(fun 22 3) #这一步并没有打印 nihao 22 33
echo $? #输出上一步return 25
echo $total
echo $?
结果
nihao
11 2
13
25
nihao 22 3
0