0
这里是shell脚本:是什么“:?”意思是在这个shell命令中?
#!/bin/bash
version="0.01";
fibonacci() {
n=${1:?If you want the nth fibonacci number, you must supply n as the first parameter.}
if [ $n -le 1 ]; then
echo $n
else
l=`fibonacci $((n-1))`
r=`fibonacci $((n-2))`
echo $((l + r))
fi
}
for i in `seq 1 10`
do
result=$(fibonacci $i)
echo "i=$i result=$result"
done
我往困惑这一行:
n=${1:?If you want the nth fibonacci number, you must supply n as the first parameter.}
我找壳的手册,但什么也没得到什么,那么“?”实际上是指。
THX