Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- ##############################
- # Configuration File Sanitiser
- ##############################
- sed -ri -e '/[[:blank:]]*#.*$/d ;/^[[:blank:]]*$/d ;s/[[:blank:]]*$// ;s/^[[:blank:]]*// ;s/[[:blank:]]*=[[:blank:]]*/=/' <file> && sort -fuo <file>
- #############
- # START NOTES
- #############
- ## in config files that have the form of key = value and uses # for comments,
- ## this little sed removes trailing and preceding whitespaces,
- ## deletes empty lines and removes comment lines.After, it sorts the file :
- ###########
- # END NOTES
- ###########
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement