9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] sam: ?changes not in sequence
@ 2006-02-08  0:01 Lyndon Nerenberg
  2006-02-08  0:07 ` Rob Pike
  2006-02-08  0:08 ` Russ Cox
  0 siblings, 2 replies; 4+ messages in thread
From: Lyndon Nerenberg @ 2006-02-08  0:01 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Given an input stream containing:

         <td>Creating XML-RPC client...</td>
       <td align="right">0.0001</td>
             <td>Creating XML-RPC client...</td>
       <td align="right">0.0001</td>
             <td>Creating XML-RPC client...</td>
       <td align="right">0.0001</td>
             <td>Creating XML-RPC client...</td>
       <td align="right">0.0001</td>
             <td>Creating XML-RPC client...</td>
       <td align="right">0.0001</td>

Should not the sam command:

	, x /^.*Creating.+\n/ d

delete lines 1,3,5,7 and 9?  Or have I lost my mind (again).  Instead of 
deleting the lines, sam spits out the "?changes not in sequence" error.

n.b.  This is Plan 9 from User Space sam (on FreeBSD 6.almost1).

--lyndon


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] sam: ?changes not in sequence
  2006-02-08  0:01 [9fans] sam: ?changes not in sequence Lyndon Nerenberg
@ 2006-02-08  0:07 ` Rob Pike
  2006-02-08  0:20   ` Lyndon Nerenberg
  2006-02-08  0:08 ` Russ Cox
  1 sibling, 1 reply; 4+ messages in thread
From: Rob Pike @ 2006-02-08  0:07 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

delete the space after the x.  it's a feature, not a bug, that
x without a delimeter means 'break into lines'.  thus
  x /pat/
and
  x/pat/
mean very different things.

-rob

On 2/7/06, Lyndon Nerenberg <lyndon@orthanc.ca> wrote:
> Given an input stream containing:
>
>          <td>Creating XML-RPC client...</td>
>        <td align="right">0.0001</td>
>              <td>Creating XML-RPC client...</td>
>        <td align="right">0.0001</td>
>              <td>Creating XML-RPC client...</td>
>        <td align="right">0.0001</td>
>              <td>Creating XML-RPC client...</td>
>        <td align="right">0.0001</td>
>              <td>Creating XML-RPC client...</td>
>        <td align="right">0.0001</td>
>
> Should not the sam command:
>
>         , x /^.*Creating.+\n/ d
>
> delete lines 1,3,5,7 and 9?  Or have I lost my mind (again).  Instead of
> deleting the lines, sam spits out the "?changes not in sequence" error.
>
> n.b.  This is Plan 9 from User Space sam (on FreeBSD 6.almost1).
>
> --lyndon
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] sam: ?changes not in sequence
  2006-02-08  0:01 [9fans] sam: ?changes not in sequence Lyndon Nerenberg
  2006-02-08  0:07 ` Rob Pike
@ 2006-02-08  0:08 ` Russ Cox
  1 sibling, 0 replies; 4+ messages in thread
From: Russ Cox @ 2006-02-08  0:08 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> Should not the sam command:
>
>         , x /^.*Creating.+\n/ d
>
> delete lines 1,3,5,7 and 9?  Or have I lost my mind (again).  Instead of
> deleting the lines, sam spits out the "?changes not in sequence" error.

There is a difference between what you wrote and

         , x/^.*Creating.+\n/ d

which is what you meant to write.  If a space follows x
then it means make x loop over lines, so you can also
use the simpler:

         ,x g/Creating/d

Russ


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] sam: ?changes not in sequence
  2006-02-08  0:07 ` Rob Pike
@ 2006-02-08  0:20   ` Lyndon Nerenberg
  0 siblings, 0 replies; 4+ messages in thread
From: Lyndon Nerenberg @ 2006-02-08  0:20 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> delete the space after the x.  it's a feature, not a bug, that
> x without a delimeter means 'break into lines'.

Okay, I get it now. I missed the implied RE that was sneaking in. Thanks.

--lyndon


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-02-08  0:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-08  0:01 [9fans] sam: ?changes not in sequence Lyndon Nerenberg
2006-02-08  0:07 ` Rob Pike
2006-02-08  0:20   ` Lyndon Nerenberg
2006-02-08  0:08 ` Russ Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).