public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: bash: setenv: command not found
@ 2001-02-08  9:42 Chet Ramey
  2001-02-08 19:43 ` Christopher Abbey
  0 siblings, 1 reply; 13+ messages in thread
From: Chet Ramey @ 2001-02-08  9:42 UTC (permalink / raw)
  To: cabbey; +Cc: cygwin, chet

> call me crazy but I like orthogonality, and logically named
> commands.

You like two completely different ways of doing assignments?

First, export foo=bar is just convenient shorthand for

foo=bar
export foo

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.

sh-style shells are much more consistent.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: bash: setenv: command not found
  2001-02-08  9:42 bash: setenv: command not found Chet Ramey
@ 2001-02-08 19:43 ` Christopher Abbey
  2001-02-09  5:03   ` Earnie Boyd
  2001-02-09 10:00   ` Bob McGowan
  0 siblings, 2 replies; 13+ messages in thread
From: Christopher Abbey @ 2001-02-08 19:43 UTC (permalink / raw)
  To: cygwin

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
export foo promotes a local shell variable into the process environ
unset foo  demotes a process environ *AND* unsets the same shell variable

> 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?

It doesn't matter. Fred had the right point: it's POSIX. You're just
doing what the spec says. I just don't much care for this aspect of
the spec, like I said, call me crazy. ;) I'll just file it in my "get
over it" file and move on with life... it's not like I'm not *used*
to this, I just don't *like* it. Besides it's such a minor item in
comparison to all the other features in bash.

> sh-style shells are much more consistent.

Agreed, they are consient, I just don't think they're orthogonal. I
tend to really like orthagonal design; I learned assembly programming
on a PDP-11 (well, ok a simulated one, 'cuz the uni's original died
a bit before I took the class) then I went out and studied x86
assembly....

p.s. for those that replied to my last... Chet's original note
finally showed up, and I figured out the problem... lousy ISP's
mail servers are taking 5-10 MINUTES to SYN_ACK... lots of stuff
is going into retry queues all over the net, no wonder my lists
are such a mess. :(

-- 
now the forces of openness have a powerful and
  unexpected new ally - http://ibm.com/linux


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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: bash: setenv: command not found
  2001-02-08 19:43 ` Christopher Abbey
@ 2001-02-09  5:03   ` Earnie Boyd
  2001-02-09 10:00   ` Bob McGowan
  1 sibling, 0 replies; 13+ messages in thread
From: Earnie Boyd @ 2001-02-09  5:03 UTC (permalink / raw)
  To: Christopher Abbey; +Cc: cygwin

Christopher Abbey wrote:
> 
> > sh-style shells are much more consistent.
> 
> Agreed, they are consient, I just don't think they're orthogonal. I
> tend to really like orthagonal design; 

Orthogonal is an unusual computer language in which your program flow
can go sideways. In actuality in can go in just about any direction you
could want. 

Reference from: http://www.muppetlabs.com/~breadbox/orth/

Earnie.

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: bash: setenv: command not found
  2001-02-08 19:43 ` Christopher Abbey
  2001-02-09  5:03   ` Earnie Boyd
@ 2001-02-09 10:00   ` Bob McGowan
  1 sibling, 0 replies; 13+ messages in thread
From: Bob McGowan @ 2001-02-09 10:00 UTC (permalink / raw)
  To: Christopher Abbey; +Cc: cygwin

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: bash: setenv: command not found
@ 2001-02-12  8:51 Chet Ramey
  0 siblings, 0 replies; 13+ messages in thread
From: Chet Ramey @ 2001-02-12  8:51 UTC (permalink / raw)
  To: cabbey; +Cc: cygwin, chet

> yep, I'm familiar with it:
> 
> foo=bar sets a local shell variable
> foo=  unsets a local shell variable

Not exactly.  It makes `foo' have a null value.  It's not the same thing.

> but where is "unexport"? how do I demote a process environment variable
> without removing it from the local shell?

Bash has `export -n'.  POSIX doesn't.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: bash: setenv: command not found
@ 2001-02-08 15:53 kulack
  0 siblings, 0 replies; 13+ messages in thread
From: kulack @ 2001-02-08 15:53 UTC (permalink / raw)
  To: Cygwin

<off-topic-drivel>
Of course, that's a pefectly reasonable opinion to have.
Dreadfully wrong of course, but reasonable.  8-)

IMO, the bash/ksh version is right. After all,
its part of the posix shell spec...
I've always liked the 'to each their own' motto.
ONE standard is OH so boring and inflexible....
8-)

</off-topic-drivel>


On 02/07/2001 at 10:50:15 PM, cygwin-owner@sources.redhat.com wrote:
> setenv/unsetenv are commands that are built into the csh family
> of shells. Under bash the equivalent built ins are export and
> unset. For example:

> CSH:  setenv name value
> BASH: export name=value
>
> CSH:  unsetenv name
> BASH: unset name

> <soapbox>
> yes, this is a stupid naming convention, and it's one
> of the things I hate the most about shells... every one
> has a different version, and different syntax. There
> needs to be ONE standard, and I'm sorry to say BASH's
> answer isn't an answer; here csh got it right.
> </soapbox>




"Do you believe that my being stronger or faster has anything
 to do with my muscles in this place?" ... "Free your mind."
Laurence Fishburne as Morpheus in 'The Matrix'.

Fred A. Kulack  -  AS/400e  Java and Java DB2 access, Jdbc, JTA, etc...
IBM in Rochester, MN  (Phone: 507.253.5982   T/L 553-5982)
mailto:kulack@us.ibm.com   Personal: mailto:kulack@bresnanlink.net
AOL Instant Messenger: Home:FKulack  Work:FKulackWrk



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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: bash: setenv: command not found
@ 2001-02-08  7:57 Schaible, Joerg
  0 siblings, 0 replies; 13+ messages in thread
From: Schaible, Joerg @ 2001-02-08  7:57 UTC (permalink / raw)
  To: cygwin

Hi Christopher

>Today, Chet Ramey wrote:
>> > <soapbox>
>> > yes, this is a stupid naming convention, and it's one
>> > of the things I hate the most about shells... every one
>> > has a different version, and different syntax. There
>> > needs to be ONE standard, and I'm sorry to say BASH's
>> > answer isn't an answer; here csh got it right.
>> > </soapbox>
>> 
>> Why do you say that csh is right and bash is wrong?
>
>call me crazy but I like orthogonality, and logically named
>commands.
>
>setenv/unsetenv is just more intuitively obvious than export/unset
>imho. I also appreciate the lack of an = in the assignments, to me
>at least the construct "export foo=bar" evaluates to "export true"
>which is illogical. (read that as 'export the result of this
>assignment'.) This allows a clean distinction between "foo=bar yada"
>and "setenv foo bar; yada" clearly in the first case foo is only
>assigned 'locally' whereas in the second its being put into the
>environment. You only need one "assignment opperator", either = (do
>it locally) or setenv (globaly) the combination of the two is
>just confusing and redundant.

export in bash is just a convenient version setting an environment variable.
Normally you would write:

set foo=bar
export foo
unset foo

First command sets foo to bar locally, second command puts foo into
environment, third will clear the variable completely. IMHO set/unset is
intuitive enough. Especially if you have to write *portable* shell scripts
for standard sh you have to do it in this way. This csh scripts really annoy
me, since csh is not available in all environments.

Regards,
Jorg

BTW: No, no, I don't wanna start a flame war ...


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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: bash: setenv: command not found
  2001-02-08  4:48 Chet Ramey
@ 2001-02-08  7:42 ` Christopher Abbey
  0 siblings, 0 replies; 13+ messages in thread
From: Christopher Abbey @ 2001-02-08  7:42 UTC (permalink / raw)
  To: cygwin

Today, Chet Ramey wrote:
> > <soapbox>
> > yes, this is a stupid naming convention, and it's one
> > of the things I hate the most about shells... every one
> > has a different version, and different syntax. There
> > needs to be ONE standard, and I'm sorry to say BASH's
> > answer isn't an answer; here csh got it right.
> > </soapbox>
> 
> Why do you say that csh is right and bash is wrong?

call me crazy but I like orthogonality, and logically named
commands.

setenv/unsetenv is just more intuitively obvious than export/unset
imho. I also appreciate the lack of an = in the assignments, to me
at least the construct "export foo=bar" evaluates to "export true"
which is illogical. (read that as 'export the result of this
assignment'.) This allows a clean distinction between "foo=bar yada"
and "setenv foo bar; yada" clearly in the first case foo is only
assigned 'locally' whereas in the second its being put into the
environment. You only need one "assignment opperator", either = (do
it locally) or setenv (globaly) the combination of the two is
just confusing and redundant.

It's a nit, I know, but it annoys me daily as I have to deal with
a half dozen different shells in the course of doing my job. I've
chosen to "standardize" on bash as much as possible, and just regret
that this one aspect of the shell is so irritating. I've considered
writing a shell function to emulate a "sane" environment handler,
but haven't yet for fear of what a reliance on that would do to my
abilty to quickly hop into a foreign environment and fix something
(which I'm called upon to do a LOT of at work).

p.s. is it just me, or are others not seeing 100% of the traffic
on the list? If you hadn't cc'd me I'd never have seen your reply,
or my orignal post for that matter.

-- 
now the forces of openness have a powerful and
  unexpected new ally - http://ibm.com/linux


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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: bash: setenv: command not found
@ 2001-02-08  4:48 Chet Ramey
  2001-02-08  7:42 ` Christopher Abbey
  0 siblings, 1 reply; 13+ messages in thread
From: Chet Ramey @ 2001-02-08  4:48 UTC (permalink / raw)
  To: cabbey; +Cc: cygwin

> the answers to your question.
> 
> setenv/unsetenv are commands that are built into the csh family
> of shells. Under bash the equivalent built ins are export and
> unset. For example:
> 
> CSH:  setenv name value
> BASH: export name=value
> 
> CSH:  unsetenv name
> BASH: unset name
> 
> <soapbox>
> yes, this is a stupid naming convention, and it's one
> of the things I hate the most about shells... every one
> has a different version, and different syntax. There
> needs to be ONE standard, and I'm sorry to say BASH's
> answer isn't an answer; here csh got it right.
> </soapbox>

Why do you say that csh is right and bash is wrong?

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: bash: setenv: command not found
  2001-02-07 19:27   ` Jeff Lu
@ 2001-02-07 20:46     ` Christopher Abbey
  0 siblings, 0 replies; 13+ messages in thread
From: Christopher Abbey @ 2001-02-07 20:46 UTC (permalink / raw)
  To: cygwin

Today, Jeff Lu wrote:
> $ info --file /usr/info/bash
> info: /usr/info/bash: No such file or directory

iirc Corinna just recently added / was asked to add
that file, so it's not too surprising it failed for you.

> BTW, what is
> FOO=bar' and `unset FOO'.

the answers to your question.

setenv/unsetenv are commands that are built into the csh family
of shells. Under bash the equivalent built ins are export and
unset. For example:

CSH:  setenv name value
BASH: export name=value

CSH:  unsetenv name
BASH: unset name

<soapbox>
yes, this is a stupid naming convention, and it's one
of the things I hate the most about shells... every one
has a different version, and different syntax. There
needs to be ONE standard, and I'm sorry to say BASH's
answer isn't an answer; here csh got it right.
</soapbox>

-- 
now the forces of openness have a powerful and
  unexpected new ally - http://ibm.com/linux


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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: bash: setenv: command not found
  2001-02-07 16:53 ` Earnie Boyd
@ 2001-02-07 19:27   ` Jeff Lu
  2001-02-07 20:46     ` Christopher Abbey
  0 siblings, 1 reply; 13+ messages in thread
From: Jeff Lu @ 2001-02-07 19:27 UTC (permalink / raw)
  To: Earnie Boyd

I got

$ info --file /usr/info/bash
info: /usr/info/bash: No such file or directory

BTW, what is
FOO=bar' and `unset FOO'.


-----Original Message-----
From: Earnie Boyd [ mailto:earnie_boyd@yahoo.com ]
Sent: Wednesday, February 07, 2001 7:53 PM
To: Jeff Lu
Cc: cygwin@cygwin.com
Subject: Re: bash: setenv: command not found


Jeff Lu wrote:
>
> Hi,
>
> I couldn't find setenv or unsetenv any where in cygwin directory.  Where
can
> I get them?
>

These are a builtin of CSH.  You're using bash.  You need to `export
FOO=bar' and `unset FOO'.

Earnie.

P.S.: `info --file /usr/info/bash' is your friend.

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: bash: setenv: command not found
  2001-02-07 16:46 Jeff Lu
@ 2001-02-07 16:53 ` Earnie Boyd
  2001-02-07 19:27   ` Jeff Lu
  0 siblings, 1 reply; 13+ messages in thread
From: Earnie Boyd @ 2001-02-07 16:53 UTC (permalink / raw)
  To: Jeff Lu; +Cc: cygwin

Jeff Lu wrote:
> 
> Hi,
> 
> I couldn't find setenv or unsetenv any where in cygwin directory.  Where can
> I get them?
> 

These are a builtin of CSH.  You're using bash.  You need to `export
FOO=bar' and `unset FOO'.

Earnie.

P.S.: `info --file /usr/info/bash' is your friend.

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bash: setenv: command not found
@ 2001-02-07 16:46 Jeff Lu
  2001-02-07 16:53 ` Earnie Boyd
  0 siblings, 1 reply; 13+ messages in thread
From: Jeff Lu @ 2001-02-07 16:46 UTC (permalink / raw)
  To: cygwin

Hi,

I couldn't find setenv or unsetenv any where in cygwin directory.  Where can
I get them?



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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2001-02-12  8:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-08  9:42 bash: setenv: command not found Chet Ramey
2001-02-08 19:43 ` Christopher Abbey
2001-02-09  5:03   ` Earnie Boyd
2001-02-09 10:00   ` Bob McGowan
  -- strict thread matches above, loose matches on Subject: below --
2001-02-12  8:51 Chet Ramey
2001-02-08 15:53 kulack
2001-02-08  7:57 Schaible, Joerg
2001-02-08  4:48 Chet Ramey
2001-02-08  7:42 ` Christopher Abbey
2001-02-07 16:46 Jeff Lu
2001-02-07 16:53 ` Earnie Boyd
2001-02-07 19:27   ` Jeff Lu
2001-02-07 20:46     ` Christopher Abbey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).