title: Bash: Echoing a echo command with a variable in bash
body: <p>Ok, here is one I am struggling with as we speak. Echoing a echo command with a variable.</p>
  
  <pre><code>echo "creating new script file."
  echo "#!/bin/bash" &gt; $servsfile
  echo "read -p "Please enter a service: " ser " &gt;&gt; $servfile
  echo "servicetest=`getsebool -a | grep ${ser}` " &gt;&gt; $servfile
  echo "if [ $servicetest &gt; /dev/null ];then " &gt;&gt; $servfile
  echo "echo "we are now going to work with ${ser}" " &gt;&gt; $servfile
  echo "else" &gt;&gt; $servfile
  echo "exit 1" &gt;&gt; $servfile
  echo "fi" &gt;&gt; $servfile
  </code></pre>
  
  <p>My goal is create a script using echo commands then run it later. I just need to figure out how to echo echo/read commands while maintaining my variables. </p>
  
  <p>edit: the variables need to transfer what's inside of them into the new file.</p>