[Novalug] need grep help
jbholland at gmail.com
Fri Mar 16 16:51:53 EDT 2012
On 3/16/12 5:42 PM, James Ewing Cottrell 3rd wrote:
> Now that I think of it, perhaps this is best: "^[ \t]*(#|$)" in other
> "Possible initial whitespace followed by either # or nothing else"
> I think we have a winner!
Kevin's original was "^[[:space:]]*(#.*)?$"
comparing them it looks to me like the [[:space]] vs [ \t] is cosmetic,
part after the ( is not - your new one is cleaner. It seems to work from
a quick check.
changed my .bash_profile to use ^[ \t]*(#|$)
hopefully it'll stay that way......
On 3/16/12 11:22 AM, Kevin Cole wrote: On Thu, Mar 15, 2012 at 20:00,
Kevin Cole <dc.loco at gmail.com <mailto: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:]]*(#.*)?$" '
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Novalug