I\'d like to know if I can colour highlight the output of a shell command that matches certain strings.
For example, if I run myCommand, with the output below:
You could try (maybe needs a bit more escaping):
BLUE="$(tput setaf 4)" BLACK="$(tput sgr0)" command | sed "s/^ERROR /${BLUE}ERROR ${BLACK}/g"