User Tools

Site Tools


computing:linux:strip_comments

This is an old revision of the document!


Strip Comments

Create this tiny shell script and use it to view configuration files at their smallest and most readable form.

Many support organizations insist you strip comments from config files to make them more readable.

vi /usr/local/bin/nocom

Then add the contents:

#!/bin/sh
echo ""
cat $1 | sed -e '/^\s*;/d' | sed -e '/^\s*$/d'

You should make the file executable:

chmod +x  /usr/local/bin/nocom

Then use the new utility like this:

nocom /path/to/config/file
computing/linux/strip_comments.1333039725.txt.gz · Last modified: 2012/03/29 10:48 by gcooper