title: With sed or awk, move line matching pattern to bottom of file
body: <p>I have a similar problem.  I need to move a line in /etc/sudoers to the end of the file.</p>
  
  <p>The line I am wanting to move: </p>
  
  <pre class="lang-none prettyprint-override"><code>#includedir /etc/sudoers.d
  </code></pre>
  
  <p>I have tried with a variable</p>
  
  <pre><code>#creates variable value
  templine=$(cat /etc/sudoers | grep "#includedir /etc/sudoers.d")
  
  #delete value
  sed '/"${templine}"/d' /etc/sudoers
  
  #write value to the bottom of the file
  cat ${templine} &gt;&gt; /etc/sudoers
  </code></pre>
  
  <p>Not getting any errors nor the result I am looking for.</p>
  
  <p>Any suggestions?</p>