Sonora Communications, Inc.

  • Increase font size
  • Default font size
  • Decrease font size

Strip Comments When Viewing Configuration Files

E-mail Print PDF

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 too.

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 

 

Last Updated on Sunday, 06 July 2008 17:31  

Your external IP

You are connecting to this site from: 38.107.179.244

Secure Client Login

Email Address:

Password: