Write a Shell Script to display the vowels and consonants in a string read from the user.
Answers
Answered by
0
Answer:
The utility grep is used to perform a match against the string. We run grep three times with three expressions (one for numbers, one for vowels and one for consonants.
The output of grep is piped to wc, which will count the matches. The -o option is used with grep to print the matched characters only. Otherwise, grep would print the entire string, with the matches in a different colour. But this would cause wc to count all the lines in the string. If -o is used, the matched characters will be printed line by line, and wc will count them (please note that these printings are not visible on the screen, as they are read by our script internally).
aaukayush:
give me the shell script please
Similar questions