From: "Maurício CA" <mauricio.antunes@gmail.com>
To: 9fans@9fans.net
Subject: Re: [9fans] Input/output
Date: Fri, 4 Dec 2009 11:13:12 -0200 [thread overview]
Message-ID: <hfb1t8$c13$1@ger.gmane.org> (raw)
In-Reply-To: <7b20ed61c1b8ecf1d0ee9c766a185837@ladd.quanstro.net>
> i think what you want is a modified ssam that reopens
> the console. the reason for this is to seperate the editing from
> the command stream. something like (for plan 9, run once)
>
> (...)
>
> or for linux (untested)
>
> (...)
Thanks, that's exactly what I need. My idea is to use this inside
sam itself with '|', so that I can easily edit small parts of big
files.
Here is my working version for linux. The only important change is
that I had to replace your use of $tty to a loop that uses 'fuser'
to find the terminal owned by $pid.
Best,
Maur�cio
#!/home/mauricio/plan9/bin/9 rc
file = $HOME ^ '/tmp/eec-' ^ $pid
cat > $file
pts = `{for (i in /dev/pts/*)
achou = `{fuser $i >[2]/dev/null | grep $pid} {
if (test -n $"achou) echo $i}}
#Note: 's' is a script that translates to sam.
s $file <[0]$pts >[1]$pts
cat $file
rm $file
next prev parent reply other threads:[~2009-12-04 13:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <<hf8tg7$hed$1@ger.gmane.org>
2009-12-03 19:34 ` erik quanstrom
2009-12-04 13:13 ` Maurício CA [this message]
2009-12-04 18:51 ` Russ Cox
2009-12-04 22:44 ` Maurício CA
2009-12-05 1:45 ` Jorden Mauro
[not found] <<3aaafc130912041745ub300dc6w498ddedfea62d837@mail.gmail.com>
2009-12-05 1:53 ` erik quanstrom
2009-12-05 4:16 ` Jorden Mauro
2009-12-03 17:45 Maurício CA
2009-12-03 18:27 ` Russ Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='hfb1t8$c13$1@ger.gmane.org' \
--to=mauricio.antunes@gmail.com \
--cc=9fans@9fans.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).