Rc forks a new process for every [non builtin] command it runs. To
avoid such, use the . command to source the script instead of running
it.
> Further, I am now a bit puzzled about whose property the 'current directory'
> is. Why isn't the directory changed to 'c' after runing either the 'a' or
> 'b' script? Is this always a local property of each shell?
Each process has a current dir. I don't think it is ever shared between them.
-sqweek
Rc forks a new process for every [non builtin] command it runs. To
avoid such, use the . command to source the script instead of running
it.
Each process has a current dir. I don't think it is ever shared between them.
-sqweek
yes, rc caches the values of its environment variables
to avoid reading all the values after every command is run.
if you want to re-get the value of an environment variable,
you can do:
ifs=() var=`{cat /env/var}
> Further, I am now a bit puzzled about whose property the 'current directory'
> is. Why isn't the directory changed to 'c' after runing either the 'a' or
> 'b' script? Is this always a local property of each shell?
in plan 9 the current working directory is per-process
(inferno is different here - it's part of the current name space).
if you want to re-get the value of an environment variable,
you can do:
ifs=() var=`{cat /env/var}
pretty sure that's a syntax error. and for simple variables, quite
wrong. this function does better, but still screws up a few things.
v=() for(v in `{cd /env; ls -Q}){
if(~ $v *'#'*)
. /env/$v
if not x=() if(! ~ $v pid status '*' ifs){
# f015; plan 9 raw alt
ifs=() eval $v '= (' `{tr '\00' '' < /env/$v >/tmp/fubar ;
echo ' ,s:'':'''':g
,s::'' '':g
,s:(\n|[^])+:''&'':g
,s:: :g
,p' |
sam -d /tmp/fubar >[2=]
} ')'
}
}
the easy (and correct) answer is
exec rc
- erik
the easy (and correct) answer is
exec rc
- erik
if you want to get values back from a script,
send them in its stdout.
2009/11/24 Rudolf Sykora <rudolf...@gmail.com>: