Skip to content

Instantly share code, notes, and snippets.

@ViktorStiskala
Created November 27, 2011 16:52
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 ViktorStiskala/1397807 to your computer and use it in GitHub Desktop.
Save ViktorStiskala/1397807 to your computer and use it in GitHub Desktop.
Display highlighted C include file
#!/bin/bash
if [ -z $1 ]
then
echo "Usage: include filename" 1>&2
exit 1
fi
filename="/usr/include/$1"
if [ ! -f $filename ]; then
echo "File not found" 1>&2
exit 1
fi
pygmentize -l c -P style=default -f terminal256 "$filename" | less -R
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment