I'm trying to write a Bash script that will read a text file and pull out every word that is followed by a comma on a new line. I tried using
grep but it prints the whole line that has a comma in it, and I have had the same trouble with
awk. How to set up this script?
For example if the text file contained a list of animals, like so: " The Veterinary clinic treats the following animals: dogs, cats, and birds" the script would display: