#test code:
#!/bin/bash
#~/test/test.sh
trap "echo 'testmessage'" DEBUG
while :
do
echo abc
sleep 6
done
#run it
~/test$sh test.sh
===============================
#result
=> trap: DEBUG: bad trap
===============================
?[shell debug]为什么当信号设置为“DEBUG”假信号时我的trap不工作,但报trap错误?