From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6999 invoked from network); 22 Dec 2002 05:24:58 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 22 Dec 2002 05:24:58 -0000 Received: (qmail 6873 invoked by alias); 22 Dec 2002 05:24:52 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18025 Received: (qmail 6864 invoked from network); 22 Dec 2002 05:24:52 -0000 Sender: m.hessling@qut.edu.au From: "Mark Hessling" Reply-to: m.hessling@qut.edu.au To: zsh-workers@sunsite.dk Subject: How to change environment from a module X-Mailer: Quality Web Email v3.0q, http://netwinsite.com/refw.htm X-Originating-IP: 131.181.143.95 Date: Sun, 22 Dec 2002 15:24:48 +1000 Priority: normal Message-id: <3e054ca0.99775.26970@imap.qut.edu.au> 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.