#!/usr/bin/envzz bash
test="score=5,grade=d,pass=f,"
shopt -s extglob
# First, remove the bits from equals to before each comma...
test="${test//=+([^,]),/,}"
# Next, remove the trailing comma.
test="${test%,}"
echo "$test"
IyEvdXNyL2Jpbi9lbnZ6eiBiYXNoCgp0ZXN0PSJzY29yZT01LGdyYWRlPWQscGFzcz1mLCIKCnNob3B0IC1zIGV4dGdsb2IKCiMgRmlyc3QsIHJlbW92ZSB0aGUgYml0cyBmcm9tIGVxdWFscyB0byBiZWZvcmUgZWFjaCBjb21tYS4uLgp0ZXN0PSIke3Rlc3QvLz0rKFteLF0pLC8sfSIKCiMgTmV4dCwgcmVtb3ZlIHRoZSB0cmFpbGluZyBjb21tYS4KdGVzdD0iJHt0ZXN0JSx9IgoKZWNobyAiJHRlc3QiCg==