How can I make the code below to return the number of words separated by space?
example='aaa bbb ccc ddd eee'
echo ${#example}
The command echo ${#example} returns total number of letters (19). What’s the best command to returns total number of words (5)?
If you want to do it without a variable