9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] \n\n\n  to  \n\n
       [not found] <1900322893@snellwilcox.com>
@ 2003-03-03 11:14 ` Steve Simon
  2003-03-04 10:26   ` Fco.J.Ballesteros
  0 siblings, 1 reply; 8+ messages in thread
From: Steve Simon @ 2003-03-03 11:14 UTC (permalink / raw)
  To: 9fans

AGC wrote a stream sam in posix C:
	http://www.westley.demon.co.uk/src/ssam-1.9.tar.gz
I always meant to have a look at it and never got round to it...

-Steve


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

* Re: [9fans] \n\n\n  to  \n\n
  2003-03-03 11:14 ` [9fans] \n\n\n to \n\n Steve Simon
@ 2003-03-04 10:26   ` Fco.J.Ballesteros
  0 siblings, 0 replies; 8+ messages in thread
From: Fco.J.Ballesteros @ 2003-03-04 10:26 UTC (permalink / raw)
  To: 9fans

> AGC wrote a stream sam in posix C:

And of course you can always wrap sam in a script just to
pretend that you have ssam.



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

* Re: [9fans] \n\n\n to \n\n
  2003-03-03 10:09 ` Douglas A. Gwyn
@ 2003-03-03 14:25   ` Dan Cross
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Cross @ 2003-03-03 14:25 UTC (permalink / raw)
  To: 9fans

> No, sam -d gets its commands from stdin, but you
> ought to be able to open from one stream and write
> to another, e.g. on Research Unix one could
> shuffle file descriptors in the Bourne shell (exec
> sometimes helped) and sam could read /dev/fd/4 and
> write /dev/fd/5 for example).  A different form of
> plumbing.

Hmm, sounds a lot like /fd/*.  rc(1) lets you shuttle file
descriptors around rather easily.

	- Dan C.



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

* Re: [9fans] \n\n\n to \n\n
  2003-02-28 18:48 Joel Salomon
@ 2003-03-03 10:09 ` Douglas A. Gwyn
  2003-03-03 14:25   ` Dan Cross
  0 siblings, 1 reply; 8+ messages in thread
From: Douglas A. Gwyn @ 2003-03-03 10:09 UTC (permalink / raw)
  To: 9fans

Joel Salomon wrote:
> .. can sam be run in streaming mode?

No, sam -d gets its commands from stdin, but you
ought to be able to open from one stream and write
to another, e.g. on Research Unix one could
shuffle file descriptors in the Bourne shell (exec
sometimes helped) and sam could read /dev/fd/4 and
write /dev/fd/5 for example).  A different form of
plumbing.


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

* Re: [9fans] \n\n\n  to  \n\n
  2003-02-28 12:42 peter a. cejchan
  2003-02-28 18:11 ` Russ Cox
@ 2003-03-03 10:08 ` Ralph Corderoy
  1 sibling, 0 replies; 8+ messages in thread
From: Ralph Corderoy @ 2003-03-03 10:08 UTC (permalink / raw)
  To: 9fans

Hi pac,

> i don't know how to translate triple newlines into double ones.
> i tried tr \n to something else and then sed,

You could do it with sed.  awk does just as well for a throw-away
one-liner.

    awk '{c = c * !length * (c != 3) + !length} c < 3'

> however, sed doesn't like long lines :-(

Use GNU sed!

Cheers,

-- 
Ralph Corderoy.      http://inputplus.co.uk/ralph/     http://troff.org/


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

* [9fans] \n\n\n to \n\n
@ 2003-02-28 18:48 Joel Salomon
  2003-03-03 10:09 ` Douglas A. Gwyn
  0 siblings, 1 reply; 8+ messages in thread
From: Joel Salomon @ 2003-02-28 18:48 UTC (permalink / raw)
  To: 9fans

> however, sed doesn't like long lines

> you could do it in sam: s/\n\n\n/\n\n/g

Was the "stream sam" mentioned in the Structured Regular Expressions paper
ever written - or can sam be run in streaming mode?

--Joel



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

* Re: [9fans] \n\n\n  to  \n\n
  2003-02-28 12:42 peter a. cejchan
@ 2003-02-28 18:11 ` Russ Cox
  2003-03-03 10:08 ` Ralph Corderoy
  1 sibling, 0 replies; 8+ messages in thread
From: Russ Cox @ 2003-02-28 18:11 UTC (permalink / raw)
  To: 9fans

you could do it in sam: s/\n\n\n/\n\n/g



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

* [9fans] \n\n\n  to  \n\n
@ 2003-02-28 12:42 peter a. cejchan
  2003-02-28 18:11 ` Russ Cox
  2003-03-03 10:08 ` Ralph Corderoy
  0 siblings, 2 replies; 8+ messages in thread
From: peter a. cejchan @ 2003-02-28 12:42 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 251 bytes --]

hi,
(sorry for this off-topic question, but)
i don't know how to translate triple newlines into double ones.
i tried tr \n to something else and then sed,
however, sed doesn't like long lines :-(
any hint appreciated,
thanks, regards,

++pac

[-- Attachment #2: Type: text/html, Size: 931 bytes --]

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

end of thread, other threads:[~2003-03-04 10:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1900322893@snellwilcox.com>
2003-03-03 11:14 ` [9fans] \n\n\n to \n\n Steve Simon
2003-03-04 10:26   ` Fco.J.Ballesteros
2003-02-28 18:48 Joel Salomon
2003-03-03 10:09 ` Douglas A. Gwyn
2003-03-03 14:25   ` Dan Cross
  -- strict thread matches above, loose matches on Subject: below --
2003-02-28 12:42 peter a. cejchan
2003-02-28 18:11 ` Russ Cox
2003-03-03 10:08 ` Ralph Corderoy

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).