前言

正常情况下,使用Shell程序-x参数打印执行日志可以满足一般的测试需求。因此,当需要更精细地调试Shell,可以通过bashdb工具实现。

1.下载

找到bash版本对应的bashdb源码并下载。

$bash -version
GNU bash,版本 4.4.19(1)-release (sparc-sun-solaris2.11)
Copyright (C) 2016 Free Software Foundation, Inc.

2.编译及安装

$cd bashdb-4.x... # <-- put name of release for 4.x...
$./configure
$make && make check
$make install
  • 如果OS默认安装的make不是GNU Make,请使用"gmake"代替"make"
  • make check执行结果会报错,但是不影响最后的安装。
============================================================================
Testsuite summary for bashdb 4.4-0.94
============================================================================
# TOTAL: 43
# PASS:  37
# SKIP:  4
# XFAIL: 0
# FAIL:  2
# XPASS: 0
# ERROR: 0
============================================================================
See test/integration/test-suite.log
Please report to https://sourceforge.net/p/bashdb/bugs/new/
============================================================================

3.确认

$bashdb --version
bashdb, release 4.4-0.94
Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐