title: bash - source builtin and $HISTCMD variable
body: <p>I encountered an unexpected behaviour from the bash 'source' builtin concerning the display of the <code>$HISTCMD</code> environment variable.</p>
  <p>I have a <code>init_things</code> file containing:</p>
  <pre><code>echo $HISTCMD
  </code></pre>
  <p>I type the following in a bash shell:</p>
  <pre><code>$&gt; echo $HISTCMD
  100
  
  $&gt; cat init_things
  echo $HISTCMD
  
  $&gt; source init_things
  1
  </code></pre>
  <p>I expected the last command to display 102.
  I tried it on a zsh shell; it displays 102 as expected.</p>
  <p>Is there a way to make bash behave as I expect? (without resetting the HISTCMD value to 1 in 'init_things')?</p>
  <p>Why is bash behaving in such a way? (I couldn't find the answer in bash man page)</p>
  <p>Is it related to bash &quot;interactivity&quot;?</p>
  <blockquote>
  <p>bash version: 4.3</p>
  <p>zsh version 5.1</p>
  </blockquote>