I have to write a script that takes a sentence and prints the word count, character count (excluding the spaces), length of each word and the length. I know that there exist
#!/bin/bash mystring="one two three test five" for token in $mystring; do echo -n "$token: "; echo -n $token | wc -m; done echo "--------------------------"; echo -n "Total words: "; echo "$mystring" | wc -w; echo -n "Total chars: "; echo "$mystring" | wc -m;