title: Source one shell script in another gives error in MacOs
body: <p>I have the below folder structure </p>
  
  <pre><code>--/foo 
  
    --- /foo/bar 
  
       ---/foo/bar/bcp_main.sh 
      ---/foo/bar/bcp_core.sh
      ---/foo/bar/second_test.sh
  </code></pre>
  
  <p>Below is my shell script </p>
  
  <p><strong>second_test.sh</strong></p>
  
  <pre><code>source   $(dirname "$0")/bcp_main.sh
  </code></pre>
  
  <p><strong>bcp_main.sh</strong> </p>
  
  <pre><code>echo "In bcp_main.sh" 
  source   $(dirname "$0")/bcp_core.sh
  func1
  </code></pre>
  
  <p><strong>bcp_core.sh</strong></p>
  
  <pre><code> source   $(dirname "$0")/bcp_query_test.sh
  
      get_date() {
        date --utc --date="$1" +"%Y-%m-%d"        # +"%Y-%m-%d %H:%M:%S"
      }
  function func1 {  
     echo "Hello $1"
  }
  </code></pre>
  
  <p>The source from second_test.sh is fine but source from bcp_main to bcp_core it says file not found </p>
  
  <pre><code>xxxxx@asj177 ~/Desktop/foo
  $ ./bar/second_test.sh
  In bcp_main.sh 
  : No such file or directory./bar/bcp_core.sh
  in bcp main
  ./bar/bcp_main.sh: line 23: func1: command not found 
  </code></pre>
  
  <p>I am trying to run this on MacOs , am I missing some thing here . The files have all the permissions . </p>