fork download
  1. #!/bin/bash
  2. s='{"id":1","color": ["green","red", "blue"]}, {"id":2, color:black}'
  3. sed ':a;s/\(\[[^][]*\)",[ \t]*"/\1,/;ta;' <<< "$s"
Success #stdin #stdout 0s 19632KB
stdin
Standard input is empty
stdout
{"id":1","color": ["green,red,blue"]}, {"id":2, color:black}