title: Convert large text block to json block
body: <p>I have a BASH script that attempts to capture the output of build/deployment logs and insert them into a Jira ticket using Jira's REST API and CURL:</p>
  
  <pre><code>curl -v  -X POST \
  -H "Content-Type: application/json" \
  --data "@header.json" \
  --data "@log.txt" \
  --data "@footer.json" \
  -H "Authorization:Basic ABC123!@#" \
  https://companyname.jira.com/rest/api/latest/issue/FOO-1234/comment
  </code></pre>
  
  <p>My problem is that the logs contain all manner of JSON tokens, which causes the insert to fail. Is there a way from BASH to clean up the text blob before posting to escape out all the illegal characters? Or a way to say "don't parse anything in this block" or similar? Worst case, I'll write some really scary AWK.</p>