Skip to content

Instantly share code, notes, and snippets.

@mshuler
Created December 7, 2010 23:18
Show Gist options
  • Save mshuler/732623 to your computer and use it in GitHub Desktop.
Save mshuler/732623 to your computer and use it in GitHub Desktop.
~/bin/minimize - strip all comments and blank lines - I use on conf files a lot..
#!/bin/sh
if [ $1 ]; then
if [ -f $1 ]; then
/bin/egrep -v '^(\s+#|#)|^(\s+$|$)' $1
else
echo " $1 is not a regular file"
exit 1
fi
else
echo " $0 needs a filename to strip.."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment