-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Robin Atwood wrote:
>grep -e ^\s+provide\s+\w /etc/init.d
>
> but, as usual, nothing is matched. What am I doing wrong?
You have to use back slashed versions of meta characters. Following
how would do that:
$ grep -e '^[[:space:]]\+provide[[
On Saturday 24 May 2008, Robin Atwood wrote:
> On Saturday 24 May 2008, Alan McKinnon wrote:
> > On Saturday 24 May 2008, Robin Atwood wrote:
> > > But why does "[[:space:]]+" work and "\s+" fail?
> >
> > Apparently because \s is not a synonym for [[:space:]]
>
> Here for a start:
> http://www.regu
On Saturday 24 May 2008, Alan McKinnon wrote:
> On Saturday 24 May 2008, Robin Atwood wrote:
> > But why does "[[:space:]]+" work and "\s+" fail?
>
> Apparently because \s is not a synonym for [[:space:]]
>
Here for a start:
http://www.regular-expressions.info/charclass.html#shorthand
and also
ht
Robin Atwood wrote:
>grep -e ^\s+provide\s+\w /etc/init.d
>
> but, as usual, nothing is matched. What am I doing wrong?
You have to use back slashed versions of metacharacters. Following
how would do that:
$ grep -e '^[[:space:]]\+provide[[:space:]]\+[a-z]\+' /etc/init.d/*
/etc/init.d/sy
On Saturday 24 May 2008, Robin Atwood wrote:
> But why does "[[:space:]]+" work and "\s+" fail?
Apparently because \s is not a synonym for [[:space:]]
I've heard this one before but never got it to work and never seen it in
writing. Do you have a reference for where you read it?
--
Alan McKinn
On Saturday 24 May 2008, Alan McKinnon wrote:
> "grep -e" is not the same thing as "egrep" or "grep -E", and
> I never managed to get \s to work as a synonym for [[:space:]]
I was wondering about that!
> Plus you need a proper file glob i your file spec
That was a typo in my post.
> Try:
> egre
On Saturday 24 May 2008, Etaoin Shrdlu wrote:
> On Saturday 24 May 2008, 17:22, Robin Atwood wrote:
> > Regexs are not my strong point! I am trying to get a list of service
> > scripts that provide virtual services. Each such script contains a
> > line like:
> >
> > provide dns
> >
> > i.e. the
On Saturday 24 May 2008, Robin Atwood wrote:
> Regexs are not my strong point! I am trying to get a list of service
> scripts that provide virtual services. Each such script contains a
> line like:
>
> provide dns
>
> i.e. the line starts with one or more spaces, followed by the text
> "provi
On Saturday 24 May 2008, Andrey Falko wrote:
> On Sat, May 24, 2008 at 11:32 AM, Andrey Falko <[EMAIL PROTECTED]> wrote:
> > On Sat, May 24, 2008 at 11:22 AM, Robin Atwood
> >
> > <[EMAIL PROTECTED]> wrote:
> >> Regexs are not my strong point! I am trying to get a list of service
> >> scripts that
On Saturday 24 May 2008, 17:22, Robin Atwood wrote:
> Regexs are not my strong point! I am trying to get a list of service
> scripts that provide virtual services. Each such script contains a
> line like:
>
> provide dns
>
> i.e. the line starts with one or more spaces, followed by the text
On Sat, May 24, 2008 at 11:32 AM, Andrey Falko <[EMAIL PROTECTED]> wrote:
> On Sat, May 24, 2008 at 11:22 AM, Robin Atwood
> <[EMAIL PROTECTED]> wrote:
>> Regexs are not my strong point! I am trying to get a list of service scripts
>> that provide virtual services. Each such script contains a line
On Sat, May 24, 2008 at 11:22 AM, Robin Atwood
<[EMAIL PROTECTED]> wrote:
> Regexs are not my strong point! I am trying to get a list of service scripts
> that provide virtual services. Each such script contains a line like:
>
>provide dns
>
> i.e. the line starts with one or more spaces, f
Regexs are not my strong point! I am trying to get a list of service scripts
that provide virtual services. Each such script contains a line like:
provide dns
i.e. the line starts with one or more spaces, followed by the text "provide",
followed by one or more spaces and a single word.
13 matches
Mail list logo