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
string="i am a string" n=$(echo $string | wc -w ) echo $n 4
The value of n can be used as an integer in expressions
eg. echo $((n+1)) 5