report which line of script we are at
- From: Harry Putnam <reader@xxxxxxxxxxx>
- Date: Wed, 21 Jan 2009 23:28:15 -0600
This may have been discussed here but I'm not thinking of a good
string to find it with,
I wondered if a shell script can be made to report which line a
function that gets called is on.
I'm thinking of something like the perl code below that does that.
I use it to help debug scripts and in this case showing where in the
script this usage() function was invoked.
if(! $somevalue){
usage();
print "USAGE tripped at Line: <". __LINE__.">\n";
exit;
}
` __LINE__ ' carries the line number as value
Is there a handy way to do that in a shell script?
.
- Follow-Ups:
- Re: report which line of script we are at
- From: Dave B
- Re: report which line of script we are at
- Prev by Date: Re: [ksh93] Use of =~
- Next by Date: ${parameter%word}
- Previous by thread: chown to "root" on a mac for xdebug for netbeans for php ide
- Next by thread: Re: report which line of script we are at
- Index(es):
Relevant Pages
|