title: How to concatenate a string and the contents of a file in BASH?
body: <p>I am trying to concatenate the contents (a block of code) of a file called <code>query.sql</code> in a <code>README.md</code> document, that already contains some text. However, I would also like this block of code to be preceded by a heading "Model answer".</p>
  
  <p>In other words, if my <code>README.md</code> file was currently structured as</p>
  
  <pre><code># Title
  
  Some text here.
  </code></pre>
  
  <p>the new file should look like</p>
  
  <pre><code># Title
  
  Some text here.
  
  ## Model answer
  
  ```sql
  Contents of query.sql
  ```
  </code></pre>
  
  <p>The subtitle <code>## Model answer</code> is currently not in any file, so the process should involve something like</p>
  
  <pre><code>cat "## Model answer\n\n```sql\n" query.sql "\n```" &gt;&gt; README.md
  </code></pre>
  
  <p>but <code>cat</code> only works with sets of files, not files and strings. How could I achieve the desired result in BASH?</p>