title: Crontab Source File
body: <p>Recently I created a bash script which I am supposed to run in cron.</p>
  
  <p>After preparing the bash script and its normal working, I put it in Cron and found that it was failing. As as second step , I removed all the environment dependencies i.e instead of just <code>file.txt</code>, I specified <code>/home/blah-blah/file.txt</code></p>
  
  <p>I still found the script to be failing still at one step. The step was a data processing tool.
  The command i executed was <code>/bin/blah-blah/processing_tool -parameter $INDEX</code> where <code>$INDEX</code> is a variable calculated within the bash script.</p>
  
  <p>Third step was to add the bash profile as source at the beginning of the bash script. Voila!!!! The script started executing perfectly from cron.</p>
  
  <p>My question is why is this happening even after I removed all the environment dependencies from my script. Also I have heard that sourcing a cron job to a bash profile is not recommended. If so, Is there any other way in which I can avoid doing this.</p>