title: BASH_VERSION is empty even though SHELL is /bin/bash
body: <p>I have run into an issue when executing script in /etc/profile.d/script.sh. On one of my machines (only this one, on the others it is running well), when I do</p>
  
  <pre><code>echo "$BASH_VERSION" &gt;&gt; /home/synek317/log
  echo "$SHELL"        &gt;&gt; /home/synek317/log
  </code></pre>
  
  <p>the result is that <code>BASH_VERSION</code> is empty, but <code>SHELL</code> is <code>/bin/bash</code>. However, when I run terminal and type <code>echo $BASH_VERSION</code>, it is filled correctly.</p>
  
  <p>I run this on Ubuntu 16.04.1.</p>
  
  <p>Do you have any ideas why is this variable empty during execution of <code>/etc/profile.d/</code> scripts?</p>