#!/bin/bash
aa () {
typeset i
i=$1
if [ $i -ge 5 ]; then
exit
fi
echo aa call bb
bb $(( i+=1 ))
}
bb () {
typeset i
i=$1
if [ $i -ge 5 ]; then
exit
fi
echo bb call aa
aa $(( i+=1 ))
}
aa 1
shell中两个函数(带参数)相互调用
最新推荐文章于 2023-07-01 15:26:51 发布
#!/bin/bash
aa () {
typeset i
i=$1
if [ $i -ge 5 ]; then
exit
fi
echo aa call bb
bb $(( i+=1 ))
}
bb () {
typeset i
i=$1
if [ $i -ge 5 ]; then
exit
fi
echo bb call aa
aa $(( i+=1 ))
}
aa 1