Subject: Re: bash: setenv: command not found
From: Bob McGowan <[email-masked]>
To: Christopher Abbey <[email-masked]>
Cc: [email-masked]
Date: Fri, 09 Feb 2001 10:05:27 -0800

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
[email-masked]

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