Wednesday, January 20, 2010
2:42 PM

Stripping comments from a file

You can run this command to strip comments (line starting with a #) and empty lines from a file in Linux:

cat /etc/squid/squid.conf | grep -v ^# | grep -v ^$

I usually run this command on squid.conf, a file heavily commented.

To save the lines to file squiD.conf, you can run:

cat /etc/squid/squid.conf | grep -v ^# | grep -v ^$ > squiD.conf

Have fun!...

0 comments:

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.