title: Write some lines to a file with a bash script
body: <p>How can I write some lines to a file in a bash script?  </p>
  
  <p>I want to write the following into a file <code>~/.inputrc</code></p>
  
  <pre><code>"\e[A": history-search-backward
  "\e[B": history-search-forward
  "\e[C": forward-char
  "\e[D": backward-char
  </code></pre>
  
  <p>Currently I have this working but somewhat ugly method, and I'm sure there should be a better way.</p>
  
  <pre><code>#!/bin/sh
  echo \"\\e[A\": history-search-backward &gt; ~/.inputrc 
  echo \"\\e[B\": history-search-forward &gt;&gt; ~/.inputrc
  echo \"\\e[C\": forward-char &gt;&gt; ~/.inputrc
  echo \"\\e[D\": backward-char &gt;&gt; ~/.inputrc
  </code></pre>