Is there a command which can be used to easily highlight (with colors, bold text or inverted back-/foreground) specific strings in stdin while passing the entire string to stdout? I'm thinking of building it, but I'd rather just use it if it already exists. Some desirable features:
- Separate highlight strings are highlighted differently, in an automatic way. For example, the first string will be highlighted in red, the second in green, the third in blue without manual configuration.
- Detects color support and falls back to bold/inverted/other highlighting methods where those are available.
- Allow for matching of regular expressions and literal strings.
- Preferably does something smart if the matches overlap, such as "foobar" and "barbar".
- Nothing is modified between stdin and stdout except for the addition of color codes.