9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] 9fans Digest, Vol 98, Issue 15
       [not found] <mailman.286.1339197321.2642.9fans@9fans.net>
@ 2012-06-08 23:44 ` Friedrich Psiorz
  2012-06-08 23:51   ` Lyndon Nerenberg
  2012-06-09  0:15   ` erik quanstrom
  0 siblings, 2 replies; 3+ messages in thread
From: Friedrich Psiorz @ 2012-06-08 23:44 UTC (permalink / raw)
  To: 9fans


> The reason seems to be that while creating a variable foo
> in rc is immediately reflected to /env/foo, the reverse is
> not true. That is, creating a new file under /env/baz does
> not update the current rc instance with a new variable $baz
>
> So in this case, putenv is actually writing to /env/foo,
> and it would be visible only if you start a new rc
> instance. (or just read from the same file.)
Ok, so I got the whole idea wrong, I guess. I thought that $var is
basically just syntactic sugar for `{cat /env/var}, so referencing a
variable would always read from /env ...
I don't really understand how and why this is not the case though, but
I'll try to find out by reading a few more manpages ...



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

* Re: [9fans] 9fans Digest, Vol 98, Issue 15
  2012-06-08 23:44 ` [9fans] 9fans Digest, Vol 98, Issue 15 Friedrich Psiorz
@ 2012-06-08 23:51   ` Lyndon Nerenberg
  2012-06-09  0:15   ` erik quanstrom
  1 sibling, 0 replies; 3+ messages in thread
From: Lyndon Nerenberg @ 2012-06-08 23:51 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs


On 2012-06-08, at 4:44 PM, Friedrich Psiorz wrote:

> I don't really understand how and why this is not the case though, but
> I'll try to find out by reading a few more manpages ...

rc caches environment variables.  It saves a read(2) every time $foo is referenced.  Whether that's a win these days is unknown and deserves a bit of research.  Or maybe rc could grow a command that flushes the env cache.

--lyndon


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

* Re: [9fans] 9fans Digest, Vol 98, Issue 15
  2012-06-08 23:44 ` [9fans] 9fans Digest, Vol 98, Issue 15 Friedrich Psiorz
  2012-06-08 23:51   ` Lyndon Nerenberg
@ 2012-06-09  0:15   ` erik quanstrom
  1 sibling, 0 replies; 3+ messages in thread
From: erik quanstrom @ 2012-06-09  0:15 UTC (permalink / raw)
  To: 9fans

> Ok, so I got the whole idea wrong, I guess. I thought that $var is
> basically just syntactic sugar for `{cat /env/var}, so referencing a
> variable would always read from /env ...
> I don't really understand how and why this is not the case though, but
> I'll try to find out by reading a few more manpages ...

it would then make sense to say $./fu.  an idea i first heard
from mike haertel.

- erik



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

end of thread, other threads:[~2012-06-09  0:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.286.1339197321.2642.9fans@9fans.net>
2012-06-08 23:44 ` [9fans] 9fans Digest, Vol 98, Issue 15 Friedrich Psiorz
2012-06-08 23:51   ` Lyndon Nerenberg
2012-06-09  0:15   ` erik quanstrom

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