-1

I have a string like this

string="10.212.1.1/29"

and when I use sed command like this I am getting error of bad option which is most probably due to /29 / is this . How I can fix this as I want to replace this part

my command is like this

sed -i "s/variable \"vpc\".*/variable \"vpc\" { default = \"$string\" }/g"  var.tf
pie
  • 97
  • 1
  • 1
  • 6

1 Answers1

1

use a different sed separator:

sed -i "s#variable \"vpc\".*#variable \"vpc\" { default = \"$string\" }#g"  var.tf
vgersh99
  • 877
  • 1
  • 5
  • 9