title: How to expand env var in ANSI C-like string and use literal newline?
body: <p>I am using herestring to pass a string (two input values with newlines) as standard input to an installer executable.
  For example, executing an installer with two inputs <code>/var/tmp</code> and <code>yes</code></p>
  
  <pre><code>#!/bin/bash
  # run_installer.sh
  
  ./installer &lt;&lt;&lt; $'/var/tmp\nyes\n'
  </code></pre>
  
  <p>But, I need to parameterize the inputs.</p>
  
  <p>e.g.</p>
  
  <pre><code>#!/bin/bash
  # run_installer.sh
  export INPUT1="$1"
  export INPUT2="$2"
  
  # does not work, it evaluates literally to: ./installer ${INPUT1} ${INPUT2}
  ./installer &lt;&lt;&lt; $'${INPUT1}\n${INPUT2}\n'
  </code></pre>
  
  <p>So that I can execute it like so:</p>
  
  <pre><code>./run_installer /var/tmp yes
  </code></pre>
  
  <p>The question that was marked as a <a href="https://stackoverflow.com/questions/28090477/n-in-variable-in-heredoc">duplicate</a> does not answer this question. It is similar in concept, but different enough to warrant it's own question.</p>