[Novalug] need grep help
Kevin Cole
dc.loco at gmail.com
Fri Mar 16 11:22:46 EDT 2012
On Thu, Mar 15, 2012 at 20:00, Kevin Cole <dc.loco at gmail.com> wrote:
>
> Been there, done that. So often in fact that I add this alias to my
>> .bash_aliases wherever I go:
>>
>> alias decomment='egrep -v "^[[:space:]]*(#.*)?$" '
>>
>>
> P.S. The pseudo-English translation of that is (sort of) "search for lines
> that do not begin with zero or more spaces followed by at least one
> occurance of zero or more hash marks, with nothing else until the end of
> the line".
>
Correction: The code is good. The psuedo-English is bad: It should read
something like "search for lines that do not match zero or more spaces at
the begining of a line, followed by zero or one occurances of (a hash mark
followed by any characters), followed by the end of the line". Still
unreadable in English, but at least more accurate.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://calypso.tux.org/pipermail/novalug/attachments/20120316/22046f47/attachment.html
More information about the Novalug
mailing list