title: Terraform escape sequence
body: <p>I am running some commands on my ec2 using remote-exec provisioner in my terraform file. But I am stuck at escaping special characters in a command. This code portion is from my main.tf file inside remote-exec provisioner portion. The error coming in terraform is &quot;Invalid character&quot; and &quot;Invalid multi-line string&quot;. I wanted correct string sequence, so that these commands can execute on my ec2.</p>
  <pre><code>&quot;VAR=$(cat contents.txt | grep '&quot;token&quot;'),
  &quot;VAR=&quot;${VAR:11}&quot;&quot;,
  &quot;VAR=&quot;${VAR:0:-1}&quot;&quot;,
  </code></pre>