tracing a ksh script within a ksh script

I normally trace a script with the ksh -x <script name> and redirect strderr to file. But if you have a script like the examble below......

vi hairy

bear=`grep bear animals`
if [ -n $bear ]
then
ksh more_animals
fi

If I ksh -x hairy it won't trace "more_animals" unless I put a -x in it. Is there a way to trace the original script and it will trace all other scripts within without actually have to add the -x? I have scripts invoking scripts that is invoking other scripts and it would be a pain to trace them all down to just add the -x.

Thanks in advance.

You can set the ENV variable to a file that has "set -x" in it. Like this:

$ cat one
#! /usr/bin/ksh

./two
./three
exit 0
$ cat two
#! /usr/bin/ksh
echo in two
exit 0
$ cat three
#! /usr/bin/ksh
echo in three
./four
exit 0
$ cat four
#! /usr/bin/ksh
echo I am number 4
exit 0
$
$
$
$
$ ./one
in two
in three
I am number 4
$
$
$
$ cat debug
set -x
$ export ENV=debug
$
$ ./one
+ ./two
+ echo in two
in two
+ exit 0
+ ./three
+ echo in three
in three
+ ./four
+ echo I am number 4
I am number 4
+ exit 0
+ exit 0
+ exit 0
$