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. Well, this doesn't return anything. If I enter the above command without $, all is ok. But, if I would like to return just that line contains CLOCK="anything" and nothing more? For example,

CLOCK="anything" # set clock of the system

and

CLOCK="anything"

are different.

Other thing... if i put:

sed '/^CLOCK=*/p' /etc/conf.d/clock

the return will be anything that contains CLOCK. Why?

I suppose that I didn't undestand the use of regular _expression_ metacharacters. So, please, anyone to explain me that?

Thanks a lot and sorry by my english...

Reply via email to