Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

How to change environment from a module



I'm writing a fairly simple module that will allow the execution of a Rexx
program within the same process as zsh.
Execution of the Rexx program works fine at the moment, but the main reason
for wanting to run a Rexx program this way is to allow the Rexx program to
make changes to the current environment; ie environment variables and
current working directory.
So, from within the module I have, I need to be able to do the following:
1) Get the current value of an environment variable
2) Set the value of an enviornment variable
3) Get the value of the current working directory
4) Set the value of the current working directory

I thought I might be able to use bin_cd() and bin_typeset() to set the
appropriate values, but at least for bin_typeset() I don't know how to set
up the "options" argument properly. When I call it, I get "invalid
option(s)" error displayed.

So my questions are:
1) Should modules be able to call builtins as described above ?
2) How does one get the values of an environment variable and current
working directory from within a module ? (There aren't really any builtins)

TIA

Cheers, Mark.



Messages sorted by: Reverse Date, Date, Thread, Author