title: How to write a multiline string to a file in Bash
body: <p>I want to rewrite a configuration file when asked from a bash script. Here is my code.</p>
  
  <pre><code>function quality {
      echo $1 &gt; ~/.livestreamerrc
      echo ".livestreamer was modified!"
  }
  
  best="stream-types=hls
  hls-segment-threads=4
  default-stream=best
  player=vlc --cache 5000"
  
  read -p "Set quality: " INPUT
  if [[ "$INPUT" == "!best" ]]; then
    quality $best
  fi
  </code></pre>
  
  <p>This code does the following to <code>.livestreamer</code> file though.</p>
  
  <pre><code>$cat ~/.livestreamerrc
  stream-types=hls
  </code></pre>
  
  <p>Why?</p>