Gentoo Archives: gentoo-user

From: Wolf Canis <wolf.canis@××××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Need help with a regex
Date: Sat, 24 May 2008 20:13:55
Message-Id: 483876FC.2070608@googlemail.com
In Reply to: [gentoo-user] Need help with a regex by Robin Atwood
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 Robin Atwood wrote:
5 > grep -e ^\s+provide\s+\w /etc/init.d
6 >
7 > but, as usual, nothing is matched. What am I doing wrong?
8
9 You have to use back slashed versions of meta characters. Following
10 how would do that:
11
12 $ grep -e '^[[:space:]]\+provide[[:space:]]\+[a-z]\+' /etc/init.d/*
13 /etc/init.d/syslog-ng: provide logger
14 /etc/init.d/vixie-cron: provide cron
15
16
17 W. Canis
18
19
20 -----BEGIN PGP SIGNATURE-----
21 Version: GnuPG v2.0.9 (GNU/Linux)
22 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
23
24 iEYEARECAAYFAkg4dvkACgkQKT9zBKF0twURhwCZAQ/vK1la7X0mTuA2yTyWavqc
25 rEIAn1yr+ytPejcRXMr/d6f/Wkg4SgSc
26 =NQmh
27 -----END PGP SIGNATURE-----
28 --
29 gentoo-user@l.g.o mailing list