Subject: Re: sh does not export variables
To: None <sigsegv@rambler.ru>
From: Thor Lancelot Simon <tls@rek.tjls.com>
List: netbsd-users
Date: 07/17/2004 09:35:58
On Sat, Jul 17, 2004 at 10:33:53PM +0100, sigsegv@rambler.ru 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
you're using.

Thor