title: Can a bash script distinguish between being called as a script and being run as a "source"?
body: <p>I have a bash script that has inside it:</p>
  
  <pre><code>exit 1
  </code></pre>
  
  <p>When I "source" this script instead of running it, it causes the caller to exit. </p>
  
  <p>Is there a way that the script can determine that it's being run with "source" and not as its script?</p>