$ echo roygbiv | tr -d "\n" | wc -m #### $ echo roygbiv | perl -e '$a=;chomp $a;printf "There are %d colors in the rainbow.\n",length $a'