[Novalug] need grep help
novalugml at jgcomp.com
Fri Mar 16 18:12:12 EDT 2012
On Fri, Mar 16, 2012 at 05:42:18PM -0400, James Ewing Cottrell 3rd wrote:
> Now that I think of it, perhaps this is best: "^[ \t]*(#|$)" in other words
> "Possible initial whitespace followed by either # or nothing else"
POSIX EREs have adopted some (all?) of perl's \<char> sequences including
"\s" to be whitespace. If you are sure you will be using POSIX compliant
egrep (including gnu's grep) it could also be:
alias decomment="egrep -v '^\s*(#|$)'"
Jon H. LaBadie novalugml at jgcomp.com
11226 South Shore Rd (703) 787-0688 (H)
Reston, VA 20190 (609) 477-8330 (C)
More information about the Novalug