Bash: A script to replace sequence of the same characters with a single character.