title: What is the difference between global scope and environment?
body: <p>Is the global scope the same as the environment?</p>
  
  <p>The <a href="https://www.gnu.org/software/bash/manual/html_node/Bash-Builtins.html" rel="nofollow noreferrer">declare builtin</a> has a <code>-g</code> option:</p>
  
  <blockquote>
    <p>The -g option forces variables to be created or modified at the global scope, even when declare is executed in a shell function. It is ignored in all other cases.</p>
  </blockquote>