title: Bash script of history command redirection to a file in a docker container
body: <p>So i have this script that works fine in my host machine </p>
  
  <pre class="lang-sh prettyprint-override"><code>#!/bin/bash -i
  history &gt; history.txt
  </code></pre>
  
  <p>but when i execute it in my docker container my history.txt looks like this : (it copies my script into the file and if i re-execute the script it does the same thing again !)</p>
  
  <pre><code>1  #!/bin/bash -i
  2  history &gt; history.txt
  </code></pre>
  
  <p>by the way when i execute "history > history.txt" directly from the terminal it works fine .</p>