On Thu, 20 Aug 2009 11:09:07 +1000 (EST) "Voytek Eymont" <[email protected]> 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="" > ... This is another way of doing it. grep ^[^#] file It removes blank lines and lines starting with a # It doesn't help with indented lines that start with a # -- Regards Mick Pollard ( lunix ) ------------------------------------------------ BOFH Excuse of the day: Delayed Comms Stackdump Error
pgp1DUzM8vOzC.pgp
Description: PGP signature
-- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
