Skip to content

Instantly share code, notes, and snippets.

@sturman
Created December 12, 2018 08:58
Show Gist options
  • Save sturman/fac2572fe9de5fba6ad60cba55296bf1 to your computer and use it in GitHub Desktop.
Save sturman/fac2572fe9de5fba6ad60cba55296bf1 to your computer and use it in GitHub Desktop.
simple bash script to download default redis.conf and remove all comments and empty lines from it
#!/usr/bin/env bash
function removeComments() {
# remove line that starts with #
sed '/^#/ d' < redis_default.conf > redis_default_without_comments.conf
# remove line that starts with space
sed '/^[[:space:]]*$/d' < redis_default_without_comments.conf > redis_default_clean.conf
}
wget http://download.redis.io/redis-stable/redis.conf -O redis_default.conf
removeComments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment