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-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, 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
* 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).