Rafael Barreto wrote:
> Hi,
> 
> I'm learning about the use of the sed command and I have some questions.
> I'm trying to read in /etc/conf.d/clock the CLOCK variable with:
> 
> sed '/^CLOCK="*"$/p' /etc/conf.d/clock
> 
> This command, in principe, must print in screen the line that contains
> CLOCK= in the begin, contains anything between double quotes and ends.

No, that's not what it does. It matches "CLOCK" at "beginning
of line" (^) followed by = followed by any number of " followed
by another ", which is the last character of the line.

You forgot the . before the *.

> Other thing... if i put:
> 
> sed '/^CLOCK=*/p' /etc/conf.d/clock
> 
> the return will be anything that contains CLOCK. Why?

No, it will return all lines, that start with CLOCK, followed
by any numbers of =. You again missed the . before the *.

> Thanks a lot and sorry by my english...

No problem at all, but please do not send HTML junk to
the list. That's not so much excusable (well, that's of
course an exaggeration by me...).

Alexander Skwar
-- 
Men of quality are not afraid of women for equality.
-- 
[email protected] mailing list

Reply via email to