read s a=${s:0:1} echo -n $a echo $s | fold -w 1 | while read c; do if [ $a != $c ]; then echo -n $c fi a=$c done