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

posted @ 2016-08-26 16:52  Big_Foot  阅读(182)  评论(0)    收藏  举报