About Me

My photo

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/E/B d-- s:++>: a-- C++(++++) UL++ P! L++ E--- W+++ N+++ w PS+ PE- !tv
b+++ G++ e++ h
------END GEEK CODE BLOCK------

Wednesday, June 22, 2005

To known only uncommented lines

Whenever I look at any config files, it has some settings as well as comments on it.
Now I want to extract only the settings to a different file to concentrate on it,add more,delete etc. and keep the commented file for reference only.
How do I separate the settings from the comments.
For eg, In /etc/Muttrc
#
# System configuration file for Mutt
#

# default list of header fields to weed when displaying
#
ignore "from " received content- mime-version status x-status message-id
ignore sender references return-path lines

# imitate the old search-body function
macro index \eb '/~b ' 'search in message bodies'
---------------------------------------

Separate the following lines from above.

ignore "from " received content- mime-version status x-status message-id
ignore sender references return-path lines
macro index \eb '/~b ' 'search in message bodies'



:g/^#/d


and then saving to a different file should do.

1 comment:

phoe6 said...

I had for the g comnand and tried futile,finally to return back here.
:g/^$/d will delete the blank lines left over as well.