How to display the line number with in the shell script being executed
Posted on 2004-09-16
I want to know some way to display the line number of the shell script being executed. For example my script might contain identical echo statements. I want to know the output being displayed is a result of which line with in the script.
for example my script might contain wit some conditional statements
echo VALUE IS $AAA
echo VALUE IS $BBB
when I run theabove script if I get a response like
VALUE IS ZEBRA
But I have no way of knowing which line resulted in this output. Is there some environmental variable that shows which line it is.