bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File name/Line numbers with tracing output.


From: Joachim Schmitz
Subject: Re: File name/Line numbers with tracing output.
Date: Tue, 24 Aug 2010 09:44:19 +0200

Edward Peschko wrote:
All,

I've been working lately at upgrading my debugging tools and
procedures, and have come to looking how I can improve debugging
bash.
I know about bash -x , but its terribly annoying because, even though
it shows the evaluated text, there is no explicit way to tie that
output back to the script that ran it. For example, with a script
like:
echo $x

Where x = 1, when you run bash -x , you will see:

+ echo 1

With no obvious way to tie this back to the place in the script that
ran bash.

What I was wondering is if there was a way to make this explicit, ie:
bash -X (or somesuch) which would output something like:
ltmain.sh:110 + echo 1

Where ltmain.sh is the name of the script, and line 110 is the line #
of the associated program.
So - does something like this exist, and if not, would it be easy to
add?
Thanks,


Have a look at PS4.
Defeult is "+ ", but you could set it to e.g.
PS4='$0:${LINENO} + '



Bye, Jojo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]