read s v1=($(echo $s | fold -s1)) v2=($(echo $s | fold -s1 | sort | uniq)) if [ ${#v1[@]} = ${#v2[@]} ]; then echo "YES" else echo "NO" fi