shell编程学习之函数1、创建函数和使用函数-bash-3.2# cat test.sh
#!/bin/bash
hello ()
{
i=1
until [ $i -gt 5 ]
do
echo $i
let i++
done
}
hello
-bash-3.2# sh test.sh
1
2
3
4
52、反回值#!/bin/bash
hello ()
{
i=1
until [ $i -gt 5 ]
do
echo $i
let i++
done
}
hello
echo $?
-bash-3.2# sh test.sh
1
2
3
4
5
0