{{egSortString}}
sed 's/\n//g; s/, */\n/g' <<<'.foo, #bar, -bla' \ | sort --key='1.2' \ | awk '{printf("%s%s", sep, $0); sep=", "} END {print ""}'
Output:
#bar, -bla, .foo