fork download
  1. #!/bin/bash
  2. s='data {
  3. x = "name",
  4. y = "job"
  5. z = "role"
  6. }'
  7. sed -r 's|(data)[[:space:]]*(\{)|\1 = \2|g' <<< "$s"
  8.  
Success #stdin #stdout 0.01s 5496KB
stdin
Standard input is empty
stdout
data = {
    x = "name",
    y = "job"
    z = "role"
  }