Fantastic! I just need the line feeds removed:
echo $1 | sed 's/./&\n/g' | head -n -1 | sort -r | uniq | tr -d '\n'
Oops - we were editing our message at the same time.
Many thanks, Dave. I would have never come up with the sed replacement.
I'm sure this could be done more efficiently in perl.