Getting issue while running it from cron while manually working fine

Hello,

I am working one one script where I am using the below code which is using to connect with MKS client when I run my script manually it works effiecently i.e. it connects with MKS client but when I run it from CRON it doesn't connect.

1)Can some one tell when it is running from cron how could I check whether the variables are getting popuated or not
2)Is there any methodwith wich I can achieve this I need to trun this script from cron.

MKS_Connection()
{
si connect --hostname=si.pan.com --port=7001 --user=Lintomation --password=Lin4tw --yes
ReturnCode=$?;
if [[ "${ReturnCode}" -ne "0" ]];then
echo "Issue found during connection" | mail -s "MKS Connection issue1 from STP" rohit.sin@tlport.com
exit 1;
else
echo "Connection to MKS Client is in progress" |mail -s "MKS Connection1 FROM STP" rohit.sin@tlport.com
fi
}
MKS_Connection

Thanks in advance

Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.