#!/bin/bash
filename="./file" # change this filename according to your requirements
red=$'\e[31m'
reset=$'\e[0m'
# read single line from $filename in $line (see last "done", last line of code)
while read -r line; do
# loop over every single word in $line
for word in $line; do
vc=$(tr -cd '[aeiouAEIOU]' <<< "$word") # remove all but vowels
case ${#vc} in # ${#vc}: number of vowels
0) # no vowel
sed -E "s/^./${red}&${reset}/" <<< "$word"
;;
1) # one vowel
sed -E "s/^([^aeiou]*)([aeiou]+)(.*)$/${red}${reset}/i" <<< "$word"
;;
*) # two or more vowels
sed -E "s/^([^aeiou]*[aeiou][^aeiou]*)([aeiou])(.*)$/${red}${reset}/i" <<< "$word"
;;
esac
done | tr "\n" " "
echo
done < "$filename"
Desvantagem: você solta espaços em branco e tabulações consecutivas na saída.
Mais informações: help <command>
ou man <command>
ou info <command>