9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Acme and the pipe command
@ 2005-11-05 20:51 Georg Neis
  2005-11-05 21:04 ` Gabriel Diaz
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Georg Neis @ 2005-11-05 20:51 UTC (permalink / raw)
  To: 9fans

Acme's man page says about Edit:
    Treat the argument as a text editing command in the style of sam(1).
    The full Sam language is implemented except for the commands k, n, q,
    and !.

However, it seems that sam's pipe command doesn't work.  For example,
    Edit ,|sort
removes all lines instead of sorting them.

Thanks to Uriel I now know that acme has its own | command.  But why this
exception?  It's even undocumented.

Regards,
Georg


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

* Re: [9fans] Acme and the pipe command
  2005-11-05 20:51 [9fans] Acme and the pipe command Georg Neis
@ 2005-11-05 21:04 ` Gabriel Diaz
  2005-11-05 21:21 ` Rob Pike
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Gabriel Diaz @ 2005-11-05 21:04 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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

Hi

It works for me.

If i put a number on each line and then Edit ,|sort -n i get numbers sorted.
(you need to have the last line with a \n to avoid an error message from
sort)

Gabi


2005/11/5, Georg Neis <gn@oglaroon.de>:
>
> Acme's man page says about Edit:
> Treat the argument as a text editing command in the style of sam(1).
> The full Sam language is implemented except for the commands k, n, q,
> and !.
>
> However, it seems that sam's pipe command doesn't work. For example,
> Edit ,|sort
> removes all lines instead of sorting them.
>
> Thanks to Uriel I now know that acme has its own | command. But why this
> exception? It's even undocumented.
>
> Regards,
> Georg
>

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

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

* Re: [9fans] Acme and the pipe command
  2005-11-05 20:51 [9fans] Acme and the pipe command Georg Neis
  2005-11-05 21:04 ` Gabriel Diaz
@ 2005-11-05 21:21 ` Rob Pike
  2005-11-06  2:58 ` Russ Cox
  2005-11-06 10:39 ` Georg Neis
  3 siblings, 0 replies; 6+ messages in thread
From: Rob Pike @ 2005-11-05 21:21 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

if the command fails for whatever reason (perhaps sort isn't in your
path), then the output will be empty and the command will delete
all the text. a message will appear in the +Errors window and you
can undo to recover the text and figure out what went wrong.

but | is implemented, i assure you.

-rob


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

* Re: [9fans] Acme and the pipe command
  2005-11-05 20:51 [9fans] Acme and the pipe command Georg Neis
  2005-11-05 21:04 ` Gabriel Diaz
  2005-11-05 21:21 ` Rob Pike
@ 2005-11-06  2:58 ` Russ Cox
  2005-11-06 10:39 ` Georg Neis
  3 siblings, 0 replies; 6+ messages in thread
From: Russ Cox @ 2005-11-06  2:58 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

>     Edit ,|sort
> removes all lines instead of sorting them.

This is true of the plan9port version, for reasons I've
never tracked down.  They have something to do
with the fact that, because of the way fsopenfd is
implemented, the command can exit before the
output has been received by acme.  I'm not sure why
Edit | doesn't work but regular | does.

On Plan 9, they both work fine.

> Thanks to Uriel I now know that acme has its own | command.  But why this
> exception?  It's even undocumented.

I am surprised, but you seem to be right that the |, <, and >
commands in acme are undocumented.  (> is like pipe
but the output goes to +Errors instead of replacing the
selection.  < replaces the selection but does not send it
to the command.)  These predate Edit by many years.

Russ


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

* Re: [9fans] Acme and the pipe command
  2005-11-05 20:51 [9fans] Acme and the pipe command Georg Neis
                   ` (2 preceding siblings ...)
  2005-11-06  2:58 ` Russ Cox
@ 2005-11-06 10:39 ` Georg Neis
  2005-11-06 14:45   ` Russ Cox
  3 siblings, 1 reply; 6+ messages in thread
From: Georg Neis @ 2005-11-06 10:39 UTC (permalink / raw)
  To: 9fans

Thanks so much for all the replies.  I'm sorry for not having mentioned
that I'm using plan9port's acme.

Btw: there's an invalid entry "acme.1" on
http://plan9.bell-labs.com/sys/man/1/INDEX.html

Regards,
Georg


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

* Re: [9fans] Acme and the pipe command
  2005-11-06 10:39 ` Georg Neis
@ 2005-11-06 14:45   ` Russ Cox
  0 siblings, 0 replies; 6+ messages in thread
From: Russ Cox @ 2005-11-06 14:45 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Fixed, thanks.

On 11/6/05, Georg Neis <gn@oglaroon.de> wrote:
> Thanks so much for all the replies.  I'm sorry for not having mentioned
> that I'm using plan9port's acme.
>
> Btw: there's an invalid entry "acme.1" on
> http://plan9.bell-labs.com/sys/man/1/INDEX.html
>
> Regards,
> Georg
>


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

end of thread, other threads:[~2005-11-06 14:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-05 20:51 [9fans] Acme and the pipe command Georg Neis
2005-11-05 21:04 ` Gabriel Diaz
2005-11-05 21:21 ` Rob Pike
2005-11-06  2:58 ` Russ Cox
2005-11-06 10:39 ` Georg Neis
2005-11-06 14:45   ` 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).