title: Docker run bash --init-file
body: <p>I'm trying to create an alias to help debug my docker containers.</p>
  
  <p>I discovered bash <a href="https://serverfault.com/a/586272/28684">accepts a <code>--init-file</code></a> option which ought to let us run some commands before passing over to interactive mode.</p>
  
  <p>So I thought I could do</p>
  
  <pre><code>docker-bash() {
    docker run --rm -it "$1" bash --init-file &lt;(echo "ls; pwd")
  }
  </code></pre>
  
  <p>But those commands don't appear to be running:</p>
  
  <pre><code> % docker-bash c7460dfcab50
  root@9c6f64a9db8c:/#
  </code></pre>
  
  <p>Is it an escaping issue or.. what's going on?</p>
  
  <pre><code>bash --init-file &lt;(echo "ls; pwd")
  </code></pre>
  
  <p>Alone in a terminal on my host machine works as expected (runs the command starts a new bash instance).</p>