Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Message-ID: <3A843167.C47D80F0@veritas.com>
Date: Fri, 09 Feb 2001 10:05:27 -0800
From: Bob McGowan <rmcgowan@veritas.com>
Organization: VERITAS Software
X-Mailer: Mozilla 4.73 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Christopher Abbey <cabbey@bresnanlink.net>
CC: cygwin@cygwin.com
Subject: Re: bash: setenv: command not found
References: <Pine.LNX.4.21.0102082043390.24358-100000@tweedle.cabbey.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Christopher Abbey wrote:
> 
> Today, Chet Ramey wrote:
> > > call me crazy but I like orthogonality, and logically named
> > > commands.
> >
> > You like two completely different ways of doing assignments?
> 
> um, yeah... if they're different concepts. I don't exactly think
> local shell variables and the global process environment should be
> manipulated with the same syntax.
> 
> > First, export foo=bar is just convenient shorthand for
> >
> > foo=bar
> > export foo
> 
> yep, I'm familiar with it:
> 
> foo=bar sets a local shell variable
> foo=  unsets a local shell variable

No, this assigns the null value to the variable.  To verify, use 'set -u' to make the shell generate an error message when a variable name is used that has not first been
created.

> export foo promotes a local shell variable into the process environ
> unset foo  demotes a process environ *AND* unsets the same shell variable

Do you mean there are two copies of the variable, one local and one global?  Regardless, the effect is to completely remove the variable from the shell, whether it is
global or local does not matter.
 
> > There is only one way to do assignment statements in sh: var=value.
> > All variable assignments are local, with the single exception of
> > variable assignments preceding a command.  `export' is the only way
> > to make a variable part of the environment.
> 
> but where is "unexport"? how do I demote a process environment variable
> without removing it from the local shell?

My experience is with sh, ksh, bash and a little csh.  None of these shells support an "unexport" or "demote" feature, as far as I'm aware.  Do any of the others?  I do
know that csh/tcsh keep both a local and global environment, I don't believe bash, or other sh like shells, do.

> It doesn't matter. Fred had the right point: it's POSIX. You're just
---deleted---

Yeh, got to conform to standards.  So, maybe this should now go offline, since it is somewhat OT?

-- 
Bob McGowan
Staff Software Quality Engineer
VERITAS Software
rmcgowan@veritas.com

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

