Created
October 8, 2012 04:09
-
-
Save isa/3850671 to your computer and use it in GitHub Desktop.
Syntax highlighting for terminal with pygmentize
This file contains hidden or 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
#!/usr/bin/env bash | |
if [ ! -t 0 ];then | |
file=/dev/stdin | |
elif [ -f $1 ];then | |
file=$1 | |
else | |
echo "Usage: $0 code.c" | |
echo "or e.g. head code.c|$0" | |
exit 1 | |
fi | |
pygmentize -f terminal -g $file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment