2012-01-12 36 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如果你希望看到什麼。)