title: yq - add a multiline string
body: <p>I am using yq (similar to jq but for yaml files). My goal is to do the following. I have a certificate file that looks similar to</p>
  
  <pre><code>-------BEGIN CERTIFICATE-------
  asdoqijepoqjwe1i49i120941p2j4omslasdajsdqweqwe
  qwelqjwkasdlajsölkjasldkjakljsdlkjasdasdpiqwe
  -------END CERTIFICATE--------
  </code></pre>
  
  <p>and I have a yaml file (in this case an Openshift Template) that looks like this</p>
  
  <pre><code>apiVersion: v1
  kind: Template
  objects:
  - apiVersion: v1
    kind: Route
    tls:
     certificate:
     key:
    someOther: stuff
  </code></pre>
  
  <p>Now my goal is to inject the certificate into the yaml so that the output looks somewhat like this</p>
  
  <pre><code>apiVersion: v1
  ...
      certificate: |
        -------BEGIN CERTIFICATE-------
        asdoqijepoqjwe1i49i120941p2j4omslasdajsdqweqwe
        qwelqjwkasdlajsölkjasldkjakljsdlkjasdasdpiqwe
        -------END CERTIFICATE--------
  </code></pre>
  
  <p>However neither an internet search nor the documenation was of any help. The closest I got was using</p>
  
  <blockquote>
    <p>yq w /tmp/template.yaml objects[0].tls.certificate "\n$(cat cert.pem)"</p>
  </blockquote>
  
  <p>leaving me with the following output</p>
  
  <pre><code>certificate: !!binary |
        fC0KLS0tLS0tLUJFR0lOIENFUlRJRklDQVRFLS0tLS0tLQphc2RvcWlqZXBvcWp3ZTFpND
        lpMTIwOTQxcDJqNG9tc2zDYXNkYWpzZMNxd2Vxd2UKcXdlbHFqd2vDYXNkbGFqc8O2bGtq
        YXNsZGtqYWtsanNkbGtqYXNkYXNkcGlxd2UKLS0tLS0tLUVORCBDRVJUSUZJQ0FURS0tLS
        0tLS0t
  </code></pre>
  
  <p>which strangely is the base64 encoded value of the one I wanted to add preceded by !!binary |. Any ideas what's going on and how I can achieve my wanted output?</p>