title: sed: bad option in substitution expression when trying to replace a string
body: <p>tr file and trying to change data in it and getting this substitution error.</p>
  <p><strong>my file data is</strong></p>
  <pre><code>variable &quot;aws_spoke_gateways&quot; {
    default = {
      spoke1 = {
        name         = &quot;AWS-UE2-Spoke1-GW&quot;
      },
      spoke2 = {
        name         = &quot;AWS-UE2-Spoke1-GW&quot;
      }
    }
  }
  </code></pre>
  <p><strong>And My desired output is</strong></p>
  <pre><code> variable &quot;aws_spoke_gateways&quot; {
        default = {
          spoke1 = {
            name         = &quot;myname&quot;
          },
          spoke2 = {
            name         = &quot;AWS-UE2-Spoke1-GW&quot;
          }
        }
      }
  </code></pre>
  <p><strong>EDIT 1</strong></p>
  <p>I want to change the values of name , size , and vpc  and both <code>spoke1</code> and <code>spoke2</code></p>
  <pre><code>variable &quot;aws_spoke_gateways&quot; {
    default = {
      spoke1 = {
        name         = &quot;AZ-EU-Spoke1-GW&quot;
        size         = &quot;Standard_B1ms&quot;
        active_mesh  = true
        single_az_ha = true
        vpc          = &quot;azure_spoke2_vnet&quot;
      },
      spoke2 = {
        name         = &quot;AZ-EU-Spoke2-GW&quot;
        size         = &quot;Standard_B1ms&quot;
        active_mesh  = true
        single_az_ha = true
        vpc          = &quot;azure_spoke2_vnet&quot;
      }
    }
  }
  </code></pre>