VDEBUG
#! /usr/bin/ksh
cat << EOF
#! /usr/bin/ksh
#
# VDEBUG() - set powerful PS4 for debug, the same as C Macro
#
VDEBUG()
{
export PS4='_DEBUG_: [\${.sh.fun}@\${.sh.file##*/}:\$LINENO|\${SECONDS%.*}]+ '
[[ \$DEBUG == ~(i)"yes" ]] && set -x
}
#
# goto_hang()
#
function goto_hang
{
typeset F=/tmp/nohang
print "*** Now go to hang, to release, please touch \$F"
rm -f \$F
for (( ;; )); do
sleep 10
[[ -f \$F ]] && print "*** Well, exit hang now" && break
done
}
EOF

浙公网安备 33010602011771号