From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@9fans.net From: =?ISO-8859-1?Q?Maur=ED=ADcio_CA?= Date: Fri, 4 Dec 2009 11:13:12 -0200 Message-ID: References: <> <7b20ed61c1b8ecf1d0ee9c766a185837@ladd.quanstro.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Thunderbird 2.0.0.23 (X11/20090817) In-Reply-To: <7b20ed61c1b8ecf1d0ee9c766a185837@ladd.quanstro.net> Subject: Re: [9fans] Input/output Topicbox-Message-UUID: a7133302-ead5-11e9-9d60-3106f5b1d025 > 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