shell 编程高手请指教。谢谢
#!/bin/sh
trap "my_exit" 2
LOOP=1
my_exit(){
echo "now you will exit, the number is $LOOP"
echo bye
exit 1
}
while 1>0
do
LOOP=`expr $LOOP + 1`
echo $LOOP
done
第一次执行显示正常
now you will exit, the number is 156
bye
第二次执行显示:
now you will exit, the number is now you will exit, the number is 67
bye
bye
请问为什么会出现这种情况。谢谢