Skip to content

Instantly share code, notes, and snippets.

@JorgenEvens
Created August 1, 2013 07:37
Show Gist options
  • Save JorgenEvens/6129237 to your computer and use it in GitHub Desktop.
Save JorgenEvens/6129237 to your computer and use it in GitHub Desktop.
Helps clean configuration file form comments
#!/bin/sh
FILE=$1
SEPARATOR="#"
if [ ! -z $2 ]; then
FILE=$2
SEPARATOR=$1
fi
cat "$FILE" | grep -v -P "^\s*${SEPARATOR}" | grep -v -P "^\s*$"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment