Skip to content

Instantly share code, notes, and snippets.

@asdil12
Created November 9, 2013 14:06
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 asdil12/7385750 to your computer and use it in GitHub Desktop.
Save asdil12/7385750 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ ! -t 0 ];then
file=/dev/stdin
elif [ -f $1 ];then
file=$1
else
echo "Usage: $0 code.c"
echo "or e.g. cat code.c | $0"
exit 1
fi
pygmentize -f terminal -g -O bg=dark $file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment