To log binary file output to a txt file

Hi,

I wrote a small script whose function is to execute the postemsg provided if the threshold breaches.

I want to log this postemsg messages to a log file. But I am not able to do. Can someone throw some light on how to log the output of this. I am pasting a snippet of that code.

export POSTEMSG=/opt/IHS.postemsg.base/postemsg
export POSTEMSGCFGFILE=/opt/IHS.postemsg.base/postemsg_aix.cfg
export SCRIPT_HOME="/"
 
$POSTEMSG -f $POSTEMSGCFGFILE -r CRITICAL -m "Guardium: CPU used is $CPUUSAGE %" hostname=$HOSTNAME sub_origin=$HOSTNAME IBMIMMGenAlert IBMHW_Trap >> $SCRIPT_HOME/.vguard.out

The binary gets executed but the output is not thrown in .vguard.out file. Any ideas?

Regards,
Dinesh:wall:

Hi,

May be the problem in SCRIPT_HOME variable??

Trying to generate the output file in root dirertory, an issue with permissions??

Regards,
Birei

Did you use "ls -l" not "ls -la" ? Your filename starts with a "." which makes it a "hidden" file.