Gcc

From Attie's Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "==Highlight the output of gcc== * warnings will be highlighted yellow * errors will be highlighted red <source lang="bash"> make 2>&1 | sed -re 's/^([^:]+:[0-9]+:[0-9]+: warn...")
 
m
Line 5: Line 5:
 
<source lang="bash">
 
<source lang="bash">
 
make 2>&1 | sed -re 's/^([^:]+:[0-9]+:[0-9]+: warning: .+)$/\x1B[93m&\x1B[m/g' -e 's/^([^:]+:[0-9]+:[0-9]+: error: .+)$/\x1B[91m&\x1B[m/g'
 
make 2>&1 | sed -re 's/^([^:]+:[0-9]+:[0-9]+: warning: .+)$/\x1B[93m&\x1B[m/g' -e 's/^([^:]+:[0-9]+:[0-9]+: error: .+)$/\x1B[91m&\x1B[m/g'
 +
</source>
 +
 +
or... how about a handy alias?
 +
<source lang="bash">
 +
alias make="make 2>&1 | sed -re 's/^([^:]+:[0-9]+:[0-9]+: warning: .+)$/\x1B[93m&\x1B[m/g' -e 's/^([^:]+:[0-9]+:[0-9]+: error: .+)$/\x1B[91m&\x1B[m/g'"
 
</source>
 
</source>

Revision as of 12:13, 9 April 2014

Highlight the output of gcc

  • warnings will be highlighted yellow
  • errors will be highlighted red
make 2>&1 | sed -re 's/^([^:]+:[0-9]+:[0-9]+: warning: .+)$/\x1B[93m&\x1B[m/g' -e 's/^([^:]+:[0-9]+:[0-9]+: error: .+)$/\x1B[91m&\x1B[m/g'

or... how about a handy alias?

alias make="make 2>&1 | sed -re 's/^([^:]+:[0-9]+:[0-9]+: warning: .+)$/\x1B[93m&\x1B[m/g' -e 's/^([^:]+:[0-9]+:[0-9]+: error: .+)$/\x1B[91m&\x1B[m/g'"
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox