variable has no value if run the script automatically/scheduled

Hi All,

I am using ksh as the shell. I have a script that should store variable after executing "onstat" on informix. I can execute it successfully without any issue if run manually, however the value is not showing up when run automatically(scheduled).
Is there anything needed to make the value assigned into PGSIZE?

here is the variable assignment i've done

PGSIZE=`onstat -b|grep buffer|awk '{print $8}'`
echo "after PAGESIZE "$PGSIZE >> space_out2.log

-------

this is the output when run manually

=> onstat -b|grep buffer|awk '{print $8}'

4096

all i want to do is to store the output into the PGSIZE variable.

all environment variables needed were setup

#!/bin/ksh
INFORMIXSERVER
INFORMIXDIR
PATH
ONCONFIG

this is the output if executed via scheduled job.

bfore PAGESIZE 4096
after PAGESIZE

<<<<<<<<<<<<<<<<<<<<<<<<< This should have "after PAGESIZE" should have "4096" if executed automatically.

also, just initializing hardcoded

PGSIZE=4096

, seems to be no problem.

Try running the command PGSIZE=`onstat -b|grep buffer` alone in your script and check the logs if all the data is dumped to the log in PGSIZE. Lets see if it is getting something. If nothing is there then try running PGSIZE=`onstat -b` and check the logs.

regards,
Ahamed