Quarkstrudel im Kopf

April 9, 2015 / Martin

Color gcc Output

I often use a little script to color the output of gcc to better find errors and warnings.

  #!/bin/bash

  sed -u -e 's%^.*: error: .*$%\x1b[37;41m&\x1b[m%' \
      -e 's%^.*: warning: .*$%\x1b[30;43m&\x1b[m%' \
      -e 's%^\S*:%\x1b[30;44m&\x1b[m%' | less -R