On Mon, 2010-06-28 at 03:56 +0100, Ralph Corderoy wrote:
> Hi Peter,
> 
> > > > temp2:       +36.0°C  (low  = +127.0°C, high = +70.0°C)  sensor = 
> > > > thermistor
> > >
> > >     Core 1 Temp: ${execi 8 sensors | sed -n '/^temp2:  */{s///; s/ 
> > > .*//p;}'}
> >
> > Well, I don't understand the last dozen or so characters, but it
> > works.
> 
> With sed, some commands operate on the specified, or addressed, lines,
> with the default being every line if no address is given, e.g. the
> common
> 
>     sed s/foo/bar/g
> 
> substitutes on every line the occurrence of the regular expression `foo'
> with the string `bar', globally, by which I mean every occurrence on the
> line, not just the first.
> 
>     1,5s/foo/bar/3
> 

Immediately, a Light bulb moment- It hadn't clicked that sed is somehow
related to ed, that I used to use years ago. 

I chucked out a book on basic editing in unix a few weeks ago.

Peter


-- 
Next meeting: Blandford Forum, Tuesday 2010-07-06 20:00
http://dorset.lug.org.uk/     http://www.linkedin.com/groups?gid=2645413
   Chat: http://www.mibbit.com/?server=irc.blitzed.org&channel=%23dorset
           List info: https://mailman.lug.org.uk/mailman/listinfo/dorset

Reply via email to