Repeating commands in bash: per line, per word, and xargs
In bash (the default shell on Mac), today we wanted to execute a command over each line of some output, separately. We wanted to grep (aka search) for some text in a file, then count the characters in each matching line. For future reference… Perform a command repeatedly, once per line of input: grep “the” …
Read moreRepeating commands in bash: per line, per word, and xargs