Created
August 1, 2011 16:45
-
-
Save ptitfred/1118495 to your computer and use it in GitHub Desktop.
Colorise stderr from a executable ; ERROR and WARNING rows are colorized in red and orange
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
error="91" | |
warning="35" | |
( $1 3>&1 1>&2- 2>&3- ) | sed \ | |
-e "s/^\(.* ERROR - \)\(.*\)$/\1\x1b[${error}m\2\x1b[0m/" \ | |
-e "s/^\(.* WARNING - \)\(.*\)$/\1\x1b[${warning}m\2\x1b[0m/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment