shell/控制脚本/移除捕捉.sh

17 lines
211 B
Bash
Raw Normal View History

2016-05-15 09:51:46 +08:00
#!/bin/bash
# removeing a set trap
trap "echo byebye" EXIT
count=1
while [ $count -le 5 ]
do
echo "Loop #$count"
sleep 3
count=$[ $count + 1 ]
done
#移除捕捉
trap - EXIT
echo "I just removed the trap"