Tuesday, February 16, 2010

Sed and Grep for lookup your squid.conf

Little Tricks For uncomment your SQUID.CONF

How to Look ur Squid.conf without Mark & Comment
# grep -v "^#" /etc/squid/squid.conf | sed -e '/^$/d'

or combine try using "sed" command
# cat /etc/squid/squid.conf | sed '/ *#/d; /^ *$/d'

How to Look ur Squid.conf without Mark & Comment and Generate As New Squid.conf
# grep -v "^#" /etc/squid/squid.conf | sed -e '/^$/d' > squid.conf-uncomment

or combine try using "sed" command
# cat /etc/squid/squid.conf | sed '/ *#/d; /^ *$/d' > squid.conf-uncommnent

No comments: