9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] acme Local command on p9p
@ 2011-02-23 10:39 hugo rivera
  2011-02-23 11:21 ` Gabriel Diaz
  2011-02-23 13:32 ` Russ Cox
  0 siblings, 2 replies; 12+ messages in thread
From: hugo rivera @ 2011-02-23 10:39 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hello,
the man page for acme on p9p reads

Local In the Plan 9 acme, this prefix causes a command to be run in
acme'sown file name space and environment variable group. On
Unix this is impossible...

is there any other way to define environment variables for acme while
it's running?
On plan9, Local var=val sets var and then all other commands I execute
with a middle click see $var. On some ocasions this is very useful.

--
Hugo



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

* Re: [9fans] acme Local command on p9p
  2011-02-23 10:39 [9fans] acme Local command on p9p hugo rivera
@ 2011-02-23 11:21 ` Gabriel Diaz
  2011-02-23 13:13   ` hugo rivera
  2011-02-23 13:32 ` Russ Cox
  1 sibling, 1 reply; 12+ messages in thread
From: Gabriel Diaz @ 2011-02-23 11:21 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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

hello

probably there are a better ways, like rc maintainng a `namespace`/env fs,
so it reads that fs creating the environment correspondant to that namespace
when started or simmiliar, but in lunix way (and with other shells) you can
use one script to launch acme that executes the arguments of the Local
script after the acme launch :-?

start_acme.sh
#/bin/bash

acme &
while a=read(named_pipe_or_simmilar); do
   $a
done;


And Local
#!/bin/bash
echo $* > named_pipe_or_simmilar

So Local export var=var could make var available

Also not sure if plumber would help you instead of using pipes.

My corporate pc barely allows me to reply emails, so this is not tested ;)

gabi


On Wed, Feb 23, 2011 at 11:39 AM, hugo rivera <uair00@gmail.com> wrote:

> Hello,
> the man page for acme on p9p reads
>
> Local In the Plan 9 acme, this prefix causes a command to be run in
> acme'sown file name space and environment variable group. On
> Unix this is impossible...
>
> is there any other way to define environment variables for acme while
> it's running?
> On plan9, Local var=val sets var and then all other commands I execute
> with a middle click see $var. On some ocasions this is very useful.
>
> --
> Hugo
>
>

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

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

* Re: [9fans] acme Local command on p9p
  2011-02-23 11:21 ` Gabriel Diaz
@ 2011-02-23 13:13   ` hugo rivera
  2011-02-23 14:34     ` Gabriel Diaz
  0 siblings, 1 reply; 12+ messages in thread
From: hugo rivera @ 2011-02-23 13:13 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

That doesn't work. I think it's because the environment variables that
acme sees are those that already existed when it was called, and not
those created afterwards.

2011/2/23 Gabriel Diaz <gdiaz@9grid.es>:
> hello
>
> probably there are a better ways, like rc maintainng a `namespace`/env fs,
> so it reads that fs creating the environment correspondant to that namespace
> when started or simmiliar, but in lunix way (and with other shells) you can
> use one script to launch acme that executes the arguments of the Local
> script after the acme launch :-?
> start_acme.sh
> #/bin/bash
> acme &
> while a=read(named_pipe_or_simmilar); do
>    $a
> done;
>
> And Local
> #!/bin/bash
> echo $* > named_pipe_or_simmilar
> So Local export var=var could make var available
> Also not sure if plumber would help you instead of using pipes.
> My corporate pc barely allows me to reply emails, so this is not tested ;)
> gabi
>
> On Wed, Feb 23, 2011 at 11:39 AM, hugo rivera <uair00@gmail.com> wrote:
>>
>> Hello,
>> the man page for acme on p9p reads
>>
>> Local In the Plan 9 acme, this prefix causes a command to be run in
>> acme'sown file name space and environment variable group. On
>> Unix this is impossible...
>>
>> is there any other way to define environment variables for acme while
>> it's running?
>> On plan9, Local var=val sets var and then all other commands I execute
>> with a middle click see $var. On some ocasions this is very useful.
>>
>> --
>> Hugo
>>
>
>



-- 
Hugo



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

* Re: [9fans] acme Local command on p9p
  2011-02-23 10:39 [9fans] acme Local command on p9p hugo rivera
  2011-02-23 11:21 ` Gabriel Diaz
@ 2011-02-23 13:32 ` Russ Cox
  2011-02-23 16:57   ` Rob Pike
  1 sibling, 1 reply; 12+ messages in thread
From: Russ Cox @ 2011-02-23 13:32 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs; +Cc: hugo rivera

> Local In the Plan 9 acme, this prefix causes a command to be run in
> acme'sown file name space and environment variable group. On
> Unix this is impossible...
>
> is there any other way to define environment variables for acme while
> it's running?
> On plan9, Local var=val sets var and then all other commands I execute
> with a middle click see $var. On some ocasions this is very useful.

It might be a good idea to change the implementation of Local
to look for the two forms

    name=value...
    cd directory

and implement only those.  Please file an issue.

Russ


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

* Re: [9fans] acme Local command on p9p
  2011-02-23 13:13   ` hugo rivera
@ 2011-02-23 14:34     ` Gabriel Diaz
  0 siblings, 0 replies; 12+ messages in thread
From: Gabriel Diaz @ 2011-02-23 14:34 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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

yes you will need something like Local echo $var to get the value back i
guess, which indeed will make the whole thing less convenient at least.

gabi


On Wed, Feb 23, 2011 at 2:13 PM, hugo rivera <uair00@gmail.com> wrote:

> That doesn't work. I think it's because the environment variables that
> acme sees are those that already existed when it was called, and not
> those created afterwards.
>
> 2011/2/23 Gabriel Diaz <gdiaz@9grid.es>:
> > hello
> >
> > probably there are a better ways, like rc maintainng a `namespace`/env
> fs,
> > so it reads that fs creating the environment correspondant to that
> namespace
> > when started or simmiliar, but in lunix way (and with other shells) you
> can
> > use one script to launch acme that executes the arguments of the Local
> > script after the acme launch :-?
> > start_acme.sh
> > #/bin/bash
> > acme &
> > while a=read(named_pipe_or_simmilar); do
> >    $a
> > done;
> >
> > And Local
> > #!/bin/bash
> > echo $* > named_pipe_or_simmilar
> > So Local export var=var could make var available
> > Also not sure if plumber would help you instead of using pipes.
> > My corporate pc barely allows me to reply emails, so this is not tested
> ;)
> > gabi
> >
> > On Wed, Feb 23, 2011 at 11:39 AM, hugo rivera <uair00@gmail.com> wrote:
> >>
> >> Hello,
> >> the man page for acme on p9p reads
> >>
> >> Local In the Plan 9 acme, this prefix causes a command to be run in
> >> acme'sown file name space and environment variable group. On
> >> Unix this is impossible...
> >>
> >> is there any other way to define environment variables for acme while
> >> it's running?
> >> On plan9, Local var=val sets var and then all other commands I execute
> >> with a middle click see $var. On some ocasions this is very useful.
> >>
> >> --
> >> Hugo
> >>
> >
> >
>
>
>
> --
> Hugo
>
>

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

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

* Re: [9fans] acme Local command on p9p
  2011-02-23 13:32 ` Russ Cox
@ 2011-02-23 16:57   ` Rob Pike
  2011-02-23 17:09     ` Russ Cox
  0 siblings, 1 reply; 12+ messages in thread
From: Rob Pike @ 2011-02-23 16:57 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs; +Cc: Russ Cox

On Wed, Feb 23, 2011 at 5:32 AM, Russ Cox <rsc@swtch.com> wrote:
>> Local In the Plan 9 acme, this prefix causes a command to be run in
>> acme'sown file name space and environment variable group. On
>> Unix this is impossible...
>>
>> is there any other way to define environment variables for acme while
>> it's running?
>> On plan9, Local var=val sets var and then all other commands I execute
>> with a middle click see $var. On some ocasions this is very useful.
>
> It might be a good idea to change the implementation of Local
> to look for the two forms
>
>    name=value...
>    cd directory
>
> and implement only those.  Please file an issue.
>
> Russ

I'm unsure if this conversation is about Plan 9 or plan9port, but in
any case I've used Local for lots of other things on Plan 9,
particularly name space manipulations.  There, I don't understand why
it needs restrictions.

Or are you just saying that on plan9port you need to do magic so you
might as well catalog the tricks?  In that case, I understand.

-rob


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

* Re: [9fans] acme Local command on p9p
  2011-02-23 16:57   ` Rob Pike
@ 2011-02-23 17:09     ` Russ Cox
  2011-02-23 17:35       ` dexen deVries
  0 siblings, 1 reply; 12+ messages in thread
From: Russ Cox @ 2011-02-23 17:09 UTC (permalink / raw)
  To: Rob Pike; +Cc: Fans of the OS Plan 9 from Bell Labs

> I'm unsure if this conversation is about Plan 9 or plan9port, but in
> any case I've used Local for lots of other things on Plan 9,
> particularly name space manipulations.  There, I don't understand why
> it needs restrictions.
>
> Or are you just saying that on plan9port you need to do magic so you
> might as well catalog the tricks?  In that case, I understand.

Yes, the idea is that on plan9port you might change
the implementation of Local to pick off var=value
and cd path and run those internally.  It could still
shell out for other commands like Local echo $foo.

Russ


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

* Re: [9fans] acme Local command on p9p
  2011-02-23 17:09     ` Russ Cox
@ 2011-02-23 17:35       ` dexen deVries
  2011-02-25 15:32         ` Russ Cox
  0 siblings, 1 reply; 12+ messages in thread
From: dexen deVries @ 2011-02-23 17:35 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Wednesday 23 of February 2011 18:09:42 Russ Cox wrote:
> > I'm unsure if this conversation is about Plan 9 or plan9port, but in
> > any case I've used Local for lots of other things on Plan 9,
> > particularly name space manipulations.  There, I don't understand why
> > it needs restrictions.
> > 
> > Or are you just saying that on plan9port you need to do magic so you
> > might as well catalog the tricks?  In that case, I understand.
> 
> Yes, the idea is that on plan9port you might change
> the implementation of Local to pick off var=value
> and cd path and run those internally.  It could still
> shell out for other commands like Local echo $foo.

How about reading /proc/$pid/environ (where $pid is the shell spawned for 
command execution) before the $pid exits and transfering all the environment 
variables back to the Acme's own environment?

I'm not sure, but I think that /proc/$pid/environ should be accessible for 
Acme after exit() by the $pid, but before Acme's waitpid($pid, ...) completes.

-- 
dexen deVries

[[[↓][→]]]

> how does a C compiler get to be that big? what is all that code doing?

iterators, string objects, and a full set of C macros that ensure
boundary conditions and improve interfaces.

ron minnich, in response to Charles Forsyth

http://9fans.net/archive/2011/02/90



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

* Re: [9fans] acme Local command on p9p
  2011-02-23 17:35       ` dexen deVries
@ 2011-02-25 15:32         ` Russ Cox
  2011-02-25 15:44           ` dexen deVries
  0 siblings, 1 reply; 12+ messages in thread
From: Russ Cox @ 2011-02-25 15:32 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs; +Cc: dexen deVries

> How about reading /proc/$pid/environ (where $pid is the shell spawned for
> command execution) before the $pid exits and transfering all the environment
> variables back to the Acme's own environment?

plan9port runs in more places than linux.


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

* Re: [9fans] acme Local command on p9p
  2011-02-25 15:32         ` Russ Cox
@ 2011-02-25 15:44           ` dexen deVries
  2011-02-25 15:51             ` roger peppe
  2011-02-25 19:01             ` David Leimbach
  0 siblings, 2 replies; 12+ messages in thread
From: dexen deVries @ 2011-02-25 15:44 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Friday 25 of February 2011 16:32:27 you wrote:
> > How about reading /proc/$pid/environ (where $pid is the shell spawned for
> > command execution) before the $pid exits and transfering all the
> > environment variables back to the Acme's own environment?
> 
> plan9port runs in more places than linux.

and which ones don't provide /proc/$pid/environ?

-- 
dexen deVries

[[[↓][→]]]

> how does a C compiler get to be that big? what is all that code doing?

iterators, string objects, and a full set of C macros that ensure
boundary conditions and improve interfaces.

ron minnich, in response to Charles Forsyth

http://9fans.net/archive/2011/02/90



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

* Re: [9fans] acme Local command on p9p
  2011-02-25 15:44           ` dexen deVries
@ 2011-02-25 15:51             ` roger peppe
  2011-02-25 19:01             ` David Leimbach
  1 sibling, 0 replies; 12+ messages in thread
From: roger peppe @ 2011-02-25 15:51 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

mac os for one

On 25 February 2011 15:44, dexen deVries <dexen.devries@gmail.com> wrote:
> On Friday 25 of February 2011 16:32:27 you wrote:
>> > How about reading /proc/$pid/environ (where $pid is the shell spawned for
>> > command execution) before the $pid exits and transfering all the
>> > environment variables back to the Acme's own environment?
>>
>> plan9port runs in more places than linux.
>
> and which ones don't provide /proc/$pid/environ?
>
> --
> dexen deVries
>
> [[[↓][→]]]
>
>> how does a C compiler get to be that big? what is all that code doing?
>
> iterators, string objects, and a full set of C macros that ensure
> boundary conditions and improve interfaces.
>
> ron minnich, in response to Charles Forsyth
>
> http://9fans.net/archive/2011/02/90
>
>



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

* Re: [9fans] acme Local command on p9p
  2011-02-25 15:44           ` dexen deVries
  2011-02-25 15:51             ` roger peppe
@ 2011-02-25 19:01             ` David Leimbach
  1 sibling, 0 replies; 12+ messages in thread
From: David Leimbach @ 2011-02-25 19:01 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs; +Cc: Fans of the OS Plan 9 from Bell Labs



Sent from my iPhone

On Feb 25, 2011, at 7:44 AM, dexen deVries <dexen.devries@gmail.com> wrote:

> On Friday 25 of February 2011 16:32:27 you wrote:
>>> How about reading /proc/$pid/environ (where $pid is the shell spawned for
>>> command execution) before the $pid exits and transfering all the
>>> environment variables back to the Acme's own environment?
>> 
>> plan9port runs in more places than linux.
> 
> and which ones don't provide /proc/$pid/environ?

Mac
> 
> -- 
> dexen deVries
> 
> [[[↓][→]]]
> 
>> how does a C compiler get to be that big? what is all that code doing?
> 
> iterators, string objects, and a full set of C macros that ensure
> boundary conditions and improve interfaces.
> 
> ron minnich, in response to Charles Forsyth
> 
> http://9fans.net/archive/2011/02/90
> 



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

end of thread, other threads:[~2011-02-25 19:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-23 10:39 [9fans] acme Local command on p9p hugo rivera
2011-02-23 11:21 ` Gabriel Diaz
2011-02-23 13:13   ` hugo rivera
2011-02-23 14:34     ` Gabriel Diaz
2011-02-23 13:32 ` Russ Cox
2011-02-23 16:57   ` Rob Pike
2011-02-23 17:09     ` Russ Cox
2011-02-23 17:35       ` dexen deVries
2011-02-25 15:32         ` Russ Cox
2011-02-25 15:44           ` dexen deVries
2011-02-25 15:51             ` roger peppe
2011-02-25 19:01             ` David Leimbach

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