bash debugger. You can use this tool to
debug bash shell script
源代码在线查看: run-opts
#!/bin/sh #$Id: run-opts,v 1.1 2006/01/30 01:50:56 rockyb Exp $ # Test bash options. if test -z "$srcdir" ; then srcdir=`pwd` fi if test -z "$builddir" ; then builddir=`pwd` fi . ${builddir}/check_common TEST_NAME='sopts' TEST_FILE="$builddir/${TEST_NAME}.check" (cd $srcdir && ${THIS_SH} ${TEST_NAME}.tests > $TEST_FILE 2>&1 < /dev/null) check_output $TEST_FILE ${srcdir}/${TEST_NAME}.right TEMP=`getopt1 -o testing 2>&1 >/dev/null` if [ 0 = $? ] ; then TEST_NAME='lopts' TEST_FILE="$builddir/${TEST_NAME}.check" (cd $srcdir && ${THIS_SH} ${TEST_NAME}.tests > $TEST_FILE 2>&1 < /dev/null) check_output $TEST_FILE ${srcdir}/${TEST_NAME}.right fi # Return code tells testing mechanism whether passed or not. exit $? #;;; Local Variables: *** #;;; mode:shell-script *** #;;; eval: (sh-set-shell "bash") *** #;;; End: ***