fork download
  1. #!/bin/bash
  2. s='ke-y_0-1="foo"
  3. key_two="bar"
  4. key_03-three="baz-jazz-mazz"
  5. key-="rax_foo"
  6. key-05-five="craz-"'
  7. sed ':a; s/^\([^=]*\)-/\1_/;ta' <<< "$s"
Success #stdin #stdout 0.01s 5432KB
stdin
Standard input is empty
stdout
ke_y_0_1="foo"
key_two="bar"
key_03_three="baz-jazz-mazz"
key_="rax_foo"
key_05_five="craz-"