put the list of things to be highlighted in a file, separated by |, e.g.: filter_initialize|filter_begin|filter_end|filter_sender|filter_recipient|filter_cleanup Then use the file as the regular expression for grep/egrep, e.g.: grep -E "`cat expressions_file`|$" --color=always mimedefang.pl | less