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

Re: Debugging /bin/sh scripts?



I did find another thing, 
trap _foo DEBUG,
where _foo is some function (or command) of your choosing. 
Do an
info bash
s
debug

-chris


Ethan Benson <erbenson@alaska.net> writes:

> sh -x is about all i have found for stepping through the script, i
> agree its rather rough, this is why i usually add debugging code to my
> script, generally just echoing various things such as variable values
> and telling me which way certain tests went.  i do this like so:
> 
> [ "$DEBUG" = 1 ] && echo 1>&2 "$PRG: DEBUG: foobar is $foo"



Reply to: