#!/bin/bash
str='first , second ,, third, ,fourth   suffix'
sed -E 's/[[:space:]]*(([,[:space:]])[[:space:]]*)+/\2/g' <<< "$str"