Skip to content

Instantly share code, notes, and snippets.

@Espenhh
Created November 4, 2013 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Espenhh/7305254 to your computer and use it in GitHub Desktop.
Save Espenhh/7305254 to your computer and use it in GitHub Desktop.
Fargelegger output rødt/gult for en vilkårlig kommando basert på warn/error i loggene
#/bin/bash
COMMAND="mvn run whatever kommandoen din for å kjøre er"
RED=$(echo -e '\033[41m\033[37m')
YELLOW=$(echo -e '\033[43m\033[37m')
NORMAL=$(echo -e '\033[0m')
$COMMAND | sed -e "s/.*WARN.*/$YELLOW&$NORMAL/" -e "s/.*ERROR.*/$RED&$NORMAL/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment