delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/02/09/13:01:11

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

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 AT veritas DOT com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019