2012-01-12 43 views
0

可能重复:
How can I make Perl and Python print each line of the program being executed?“SH -x” 等效Perl和Python脚本

我正在寻找的sh -x为Perl和Python等效。

+1

参见[这里] [1]前一个问题 [1]:HTTP://计算器.com/questions/2872089/how-can-i-make-perl-and-python-print-the-line-of-the-program-being-executed – 2012-01-12 15:49:50

+1

http://stackoverflow.com/questions/2872089/how -can-i-make-perl-and-python-print-正在执行的程序的每一行 先前提问 – 2012-01-12 15:52:01

回答

7

(从编程的Perl的调试器上章摘录)。

如果.perldb文件包含:

parse_options("NonStop=1 LineInfo=tperl.out AutoTrace"); 

那么你的程序将无需人工干预运行,把跟踪 信息成文件tperl.out。 (如果中断,你最好 重置LineInfo/dev/tty如果你希望看到什么。)