9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] command output on acme
@ 2009-05-08  9:41 hugo rivera
  2009-05-08 14:34 ` Anthony Sorace
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: hugo rivera @ 2009-05-08  9:41 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hello,
sometimes, when I execute a few times some external commands on a
directory with multiple files on it (an external command like tail +0f
on different files that are constantly appended), it is nice to have
the output of each command on its own window, and not having all
outputs mixed in /whatever/dir/+Errors.
I think the way to go is to write something (probably an script) that
redirects the command's output to a single window by interacting with
the files in /mnt/acme/new and /mnt/acme/ID. Nevertheless I am not
quite sure on how to proceed with this, so any suggestions are
welcome.
Also, when I have just one tail command running, acme's Kill command
is fine when I no longer need it, but when you have >3 tail commands
running at the same time, Kill doesn't work so good anymore. Does acme
keep the pids of the external commands it runs somewhere so I can know
which ones I need to kill? in other words, say that I have 4 tail
commands running on some dir, with each of them showing their outputs
on its own window, how can I put the right argument to Kill on the
window tag so I can get rid of the command when I saw enough of the
file?
Saludos y gracias

--
Hugo



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

* Re: [9fans] command output on acme
  2009-05-08  9:41 [9fans] command output on acme hugo rivera
@ 2009-05-08 14:34 ` Anthony Sorace
  2009-05-08 14:50 ` erik quanstrom
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Anthony Sorace @ 2009-05-08 14:34 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

the solution for you depends, i guess, on how often you're doing this
and what the workflow really is, but if a bit of manual intervention
is okay, you have a ready-made solution: run command 1, change the tag
on the resulting window, run command 2. acme just looks for an
existing window with the expected tag to stick its output in, creating
one if it doesn't exist. this also makes saving sessions really easy:
change the tag to the filename you'd like it to have, type Put,
execute. you can do that trick for 'win' windows for session saving,
too. handy.

no info on your kill problem, sorry.



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

* Re: [9fans] command output on acme
  2009-05-08  9:41 [9fans] command output on acme hugo rivera
  2009-05-08 14:34 ` Anthony Sorace
@ 2009-05-08 14:50 ` erik quanstrom
  2009-05-08 15:31 ` Russ Cox
  2009-05-08 15:33 ` roger peppe
  3 siblings, 0 replies; 7+ messages in thread
From: erik quanstrom @ 2009-05-08 14:50 UTC (permalink / raw)
  To: 9fans

On Fri May  8 05:43:17 EDT 2009, uair00@gmail.com wrote:
> Hello,
> sometimes, when I execute a few times some external commands on a
> directory with multiple files on it (an external command like tail +0f
> on different files that are constantly appended), it is nice to have
> the output of each command on its own window, and not having all
> outputs mixed in /whatever/dir/+Errors.
[...]
> Also, when I have just one tail command running, acme's Kill command
> is fine when I no longer need it, but when you have >3 tail commands
> running at the same time, Kill doesn't work so good anymore.

perhaps this is why i'm such an inveterate user of win.  or maybe
it's the other way around.

either way, you can dodge both problems by doing tail -f in a win
window and using <del> to kill off your tail processes.

admittedly, this is an unsatisfying dodge.

- erik



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

* Re: [9fans] command output on acme
  2009-05-08  9:41 [9fans] command output on acme hugo rivera
  2009-05-08 14:34 ` Anthony Sorace
  2009-05-08 14:50 ` erik quanstrom
@ 2009-05-08 15:31 ` Russ Cox
  2009-05-08 15:33 ` roger peppe
  3 siblings, 0 replies; 7+ messages in thread
From: Russ Cox @ 2009-05-08 15:31 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

win takes a command to run as an argument.

win tail -f yourfile

would be almost exactly what you want.
You'd just delete the window when you're done watching.

The only problem is that on Plan 9, Del in the
new window doesn't send a "hangup" note to tail,
but it should.

% diff -c /n/sources/plan9/acme/bin/source/win/main.c .
/n/sources/plan9/acme/bin/source/win/main.c:107,112 - ./main.c:107,113
  	while(*s==' ' || *s=='\t' || *s=='\n')
  		s++;
  	if(strcmp(s, "Delete")==0 || strcmp(s, "Del")==0){
+ 		write(notepg, "hangup", 6);
  		windel(w, 1);
  		threadexitsall(nil);
  		return 1;
%

Russ


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

* Re: [9fans] command output on acme
  2009-05-08  9:41 [9fans] command output on acme hugo rivera
                   ` (2 preceding siblings ...)
  2009-05-08 15:31 ` Russ Cox
@ 2009-05-08 15:33 ` roger peppe
  2009-05-08 18:59   ` Rob Pike
  3 siblings, 1 reply; 7+ messages in thread
From: roger peppe @ 2009-05-08 15:33 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

2009/5/8 hugo rivera <uair00@gmail.com>:
> Hello,
> sometimes, when I execute a few times some external commands on a
> directory with multiple files on it (an external command like tail +0f
> on different files that are constantly appended), it is nice to have
> the output of each command on its own window, and not having all
> outputs mixed in /whatever/dir/+Errors.

if i want to this, i tend to either a) start another win process
as others have said, or b) click New, and in the new window
type "<tail -f foo", Esc (to select that text) and middle click
it to execute it. the only down side of this is that it
doesn't automatically scroll to the bottom when new text arrives,
but that's not always what you want anyway.

it's a powerful technique e.g. a very quick way of getting a date
stamp into the current document: type "<date", Esc, middle click.


> I think the way to go is to write something (probably an script) that
> redirects the command's output to a single window by interacting with
> the files in /mnt/acme/new and /mnt/acme/ID. Nevertheless I am not
> quite sure on how to proceed with this, so any suggestions are
> welcome.
> Also, when I have just one tail command running, acme's Kill command
> is fine when I no longer need it, but when you have >3 tail commands
> running at the same time, Kill doesn't work so good anymore. Does acme
> keep the pids of the external commands it runs somewhere so I can know
> which ones I need to kill? in other words, say that I have 4 tail
> commands running on some dir, with each of them showing their outputs
> on its own window, how can I put the right argument to Kill on the
> window tag so I can get rid of the command when I saw enough of the
> file?
> Saludos y gracias
>
> --
> Hugo
>
>



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

* Re: [9fans] command output on acme
  2009-05-08 15:33 ` roger peppe
@ 2009-05-08 18:59   ` Rob Pike
  2009-05-11 14:03     ` hugo rivera
  0 siblings, 1 reply; 7+ messages in thread
From: Rob Pike @ 2009-05-08 18:59 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

A long time ago I wrote an rc program called 'new' that automated the
creation of a new window to hold a command's output.

It's installed in /acme/bin/new

-rob



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

* Re: [9fans] command output on acme
  2009-05-08 18:59   ` Rob Pike
@ 2009-05-11 14:03     ` hugo rivera
  0 siblings, 0 replies; 7+ messages in thread
From: hugo rivera @ 2009-05-11 14:03 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Thanks to all for your advices. I am constantly amazed by acme's versatility.
Saludos
--
Hugo



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

end of thread, other threads:[~2009-05-11 14:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-08  9:41 [9fans] command output on acme hugo rivera
2009-05-08 14:34 ` Anthony Sorace
2009-05-08 14:50 ` erik quanstrom
2009-05-08 15:31 ` Russ Cox
2009-05-08 15:33 ` roger peppe
2009-05-08 18:59   ` Rob Pike
2009-05-11 14:03     ` hugo rivera

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