Friday, 4 September 2009

Remove all comments and empty lines from SAMBA config file

grep -v "[#]" smb.conf |grep -v [\;]|grep -v ^$

Later I'll try the same other ways.

Below are sed script what to make the same:
#cat blank

And command line:
#sed -f blank smb.conf

Same as befor but in one line:
#sed -e "/^$/d; /^;/d; /^#/d" smb.conf

1 comment:

John Szewczyk said...

This is highly valuable.

Thank You.