a=A read s echo $s | grep -o . | while read c; do if [ $a != $c ]; then echo -n $c fi a=$c done