#!/bin/bash # Prompt the user for a string echo -n "Enter a string: " read str # Initialize counters for vowels, consonants, and numbers vowels=0 consonants=0 numbers=0 # Loop through each character in the string for char in $(echo "$str" | grep -o .) do # Check if the character is a vowel if [[ $char =~ [aeiouAEIOU] ]] then ((vowels++)) # Check if the character is a consonant elif [[ $char =~ [bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ] ]] then ((consonants++)) # Otherwise, the character must be a number else ((numbers++)) fi done
Program
Facebook
Twitter
WhatsApp
Telegram
Read Must