I'm wondering if there a way of capturing a list of the processes executed on a non-interactive shell? 

Basically I have a script which calls some variables from other sources and I want to see what the values of said variables are. However, the script executes and finishes very quickly so I can't capture the values using ps. 

Is there a way to log processes and what arguments were used?

TIA
Huskie

EDIT:

I'm using Solaris in this instance. I even thought about about having a quick looping script to capture the values being passed - but this doesn't seem very accurate and I'm sure executions aren't always being captured.
I tried this:

```
   #!/bin/ksh

   while [ true ]
   do

   ps -ef | grep  $SCRIPT_NAME |egrep -v 'shl|lis|grep' >> grep_out.txt

   done

```

I'd use sleep but I can't specify any precision as all my sleep executables want an integer value rather than any fractional value.