I'm using
if[ "$wordCount" -gt 10 ]
To check if there are more than 10 words in the line, but how can I also check if a specific string, say "Brown Cow" is also within the line?
So the conditional should only work if the line has a wordCount of over 10 and contains the string "Brown Cow" within the $line string. Is there a way to do that within Linux/Bash? Or will I need a multi-line or different conditional like case to do it?
Aucun commentaire:
Enregistrer un commentaire