Skip to content

Instantly share code, notes, and snippets.

@jlongman
Created May 11, 2015 19:46
Show Gist options
  • Save jlongman/07d5ec6d643644c18ad3 to your computer and use it in GitHub Desktop.
Save jlongman/07d5ec6d643644c18ad3 to your computer and use it in GitHub Desktop.
colour code stdout/stderr
#!/bin/bash
echo -en "\033[31m" ## red
eval $* | while read line; do
echo -en "\033[36m" ## blue
echo $line
echo -en "\033[31m" ## red
done
echo -en "\033[0m" ## reset color
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment