On Thu, Aug 20, 2009 at 11:09:07AM +1000, Voytek Eymont wrote:
> how can I output a config file with only the valid directives, but not all
> the '#' commented lines ?
> 
> # cat /etc/sysconfig/iptables-config
> 
> # Load additional iptables modules (nat helpers)
> #   Default: -none-
> # Space separated list of nat helpers (e.g. 'ip_nat_ftp ip_nat_irc'), which
> # are loaded after the firewall rules are applied. Options for the helpers
> are
> # stored in /etc/modules.conf.
> IPTABLES_MODULES=""
> ....
> 
> so to get only
> IPTABLES_MODULES=""

grep -v '^#' /etc/sysconfig/iptables-config

^ means beginning of the line
# mean #

-v means "everything except what matches"

-- 
Norman Gaywood, Computer Systems Officer
University of New England, Armidale, NSW 2351, Australia

[email protected]            Phone: +61 (0)2 6773 3337
http://mcs.une.edu.au/~norm    Fax:   +61 (0)2 6773 3312

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to