Gentoo Archives: gentoo-user

From: Alexander Skwar <listen@×××××××××××××××.name>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] About sed
Date: Mon, 07 Nov 2005 08:01:33
Message-Id: 436F0701.8070606@mid.message-center.info
In Reply to: [gentoo-user] About sed by Rafael Barreto
1 Rafael Barreto wrote:
2 > Hi,
3 >
4 > I'm learning about the use of the sed command and I have some questions.
5 > I'm trying to read in /etc/conf.d/clock the CLOCK variable with:
6 >
7 > sed '/^CLOCK="*"$/p' /etc/conf.d/clock
8 >
9 > This command, in principe, must print in screen the line that contains
10 > CLOCK= in the begin, contains anything between double quotes and ends.
11
12 No, that's not what it does. It matches "CLOCK" at "beginning
13 of line" (^) followed by = followed by any number of " followed
14 by another ", which is the last character of the line.
15
16 You forgot the . before the *.
17
18 > Other thing... if i put:
19 >
20 > sed '/^CLOCK=*/p' /etc/conf.d/clock
21 >
22 > the return will be anything that contains CLOCK. Why?
23
24 No, it will return all lines, that start with CLOCK, followed
25 by any numbers of =. You again missed the . before the *.
26
27 > Thanks a lot and sorry by my english...
28
29 No problem at all, but please do not send HTML junk to
30 the list. That's not so much excusable (well, that's of
31 course an exaggeration by me...).
32
33 Alexander Skwar
34 --
35 Men of quality are not afraid of women for equality.
36 --
37 gentoo-user@g.o mailing list