title: Different mail from shell script and cron running the script
body: <p>I have a <code>perl</code> script that executes a command. I am saving the output of this command to an array and checking the content on the output to mail me a success or a failure message. </p>
  
  <p>This works fine when i run the script itself. But when i schedule the script to run as a <code>cronjob</code> i get a failure mail irrespective of the output. </p>
  
  <p>I am using all the <code>abs paths</code> in script and know the cron is executing since i see in my logs that the <code>command is executed successfully</code>. </p>
  
  <p>Can someone tell me why the difference? </p>
  
  <p>One thing to notice is, the command takes about a minute to finish executing and the script is waiting till the command is executed to check the output. So i am seeing a little delay in the mail when i run the script. But in the cron, i get a mail immediately at the run time. I am assuming the cron isn't waiting for the command to execute and check the output.</p>
  
  <p>Could that be the case?</p>