shell类c问题,求教
#!/bin/bashi=0
(
while (( i < 3 ))
do
echo hello
i=`expr $i + 1`
sleep 1
done
echo "i=$i"
)
echo "i=$i"
文件名:test1.sh
dangming@dangming-desktop:~/user/review/shell$ sh test1.sh
test1.sh: 12: cannot open 3: No such file
test1.sh: 12: i: not found
i=0
i=0
不知道错在哪里,我的ubuntu是这个结果,别人的redhat、ubu可以执行