Quantcast
Viewing all articles
Browse latest Browse all 102

Awk/Sed commands find and replace pattern

I have a file with data like the following. xyz can be anything, so I want to replace it.

variable "azure_spoke_gateways" {  default = {    spoke1 = {      name         = "xyz"      size         = "max"      vpc          = "azure_spoke1_vnet"    },  }}variable "google_spoke_gateways" {  default = {    spoke1 = {      name         = "xyz"      size         = "max"      vpc          = "azure_spoke1_vnet"    },  }}

I just want to replace value of variable azure_spoke_gateways's name. The desired output is:

  variable "azure_spoke_gateways" {      default = {        spoke1 = {          name         = "MYSTRING"          size         = "max"          vpc          = "azure_spoke1_vnet"        },      }    }

Viewing all articles
Browse latest Browse all 102

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>