Subject: Re: sh does not export variables
To: None <email@example.com>
From: Thor Lancelot Simon <firstname.lastname@example.org>
Date: 07/17/2004 09:35:58
On Sat, Jul 17, 2004 at 10:33:53PM +0100, email@example.com wrote:
> I've been working with various shell scripts and found out that /bin/sh
> does not export variables. I'm running NetBSD-2.0F. Below is a simple
> shell script, which sets 3 variables and then prints out their values,
> after the script exits, the variables are not exported. Does anyone know
> what's going on here?
Child processes can't change their parent process' environment. This
won't work with any shell, on any Unix system.
If you want to run a shell script in the environment of your current
shell, you need to run it with "." or "source" depending on which shell