fork(2) download
  1. #!/usr/bin/envzz bash
  2.  
  3. test="score=5,grade=d,pass=f,"
  4.  
  5. shopt -s extglob
  6.  
  7. # First, remove the bits from equals to before each comma...
  8. test="${test//=+([^,]),/,}"
  9.  
  10. # Next, remove the trailing comma.
  11. test="${test%,}"
  12.  
  13. echo "$test"
  14.  
Success #stdin #stdout 0s 5028KB
stdin
Standard input is empty
stdout
score,grade,pass