Add comma after closing bracket } using bash.
Using
sed 's/variable/&,/g;s/,$//'
adds comma after variable, however,
sed 's/}/&,/g;s/,$//'
doesn't work.
Input:
variable "policy_name1" {
description = "abc xyz"
type = string
default = [
"test1"
"test2"
]
}
variable "policy_name2" {
description = "abc xyz"
type = bool
default = false
}
Output:
variable "policy_name1" {
description = "abc xyz"
type = string
default = [
"test1"
"test2"
]
},
variable "policy_name2" {
description = "abc xyz"
type = bool
default = false
}