12 Feb
2004
12 Feb
'04
08:41
I want to grep lines that not commented from a file, Someone said that I can use $sed -e '/^[[:space:]]*#/d;/^[[:space:]]*$/d' file.conf
--> Another idea to remove these kind of comments, even if they do not start in the beginning of the line:
sed -e 's/#.*//g'|grep -v '^$'
Oh, this seems to turn into a golf contest.-) Here, this works: grep -vP '^[ \t]*(#|$)' This should work too, but for some reason grep dumps core: grep -vP '^\s*(#|$)' -jk