On Sun, Nov 06, 2005 at 09:03:01PM -0800, gentuxx wrote:
> sed -n '/^CLOCK=/s/^\(CLOCK=".*"\).*$/\1/p /etc/conf.d/clock
> 

Ah, yes, I misunderstood the OP. I thought he didn't want the lines
with trailing comments at all. 

But is it necessary to give the address for an s// replacement? As I
understand it that sed is a stream editor and will try the replacement
on every "line" it encounters. The -n flag would guarantee only the
line changed would be printed anyway. 

I guess what I am saying is that 
  sed -n 's/^\(CLOCK=".*"\).*$/\1/p' /etc/conf.d/clock
would do just as fine, no?

W
-- 
The particle physicists use order parameter fields, too. Their 
order parameter fields also hide lots of details about what their
quarks and gluons are composed of. The main difference is that
they don't know of what their fields are composed. It ought to
be reassuring to them that we don't always find our greater
knowledge very helpful.
   ~James P. Sethna "Order Parameters, Broken Symmetry, and Topology"
Sortir en Pantoufles: up 4 days,  8:10
-- 
gentoo-user@gentoo.org mailing list

Reply via email to