[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: OSTYPE (etc.) is clobbered
From: |
Chet Ramey |
Subject: |
Re: OSTYPE (etc.) is clobbered |
Date: |
Thu, 11 Jan 2001 13:10:30 -0500 |
> First, I can understand wanting to set this variable, but bash should
> not set the variable if it is already set. This is a design decision
> with which some may disagree
This seems reasonable; I will think about making the setting of
OSTYPE, HOSTTYPE, and MACHTYPE conditional on the variables not being
previously defined.
>but you cannot disagree with the second problem here:
I can and do.
> Second, when bash is run as sh (e.g., /bin/sh) it is supposed to
> behave as much as possible like the old Bourne Shell, yet bash2 still
> clobbers OSTYPE. Does POSIX define how OSTYPE is handled?
This is a misconception. When called as sh, bash attempts to emulate
the *startup behavior* of historical versions of sh. After that, it
runs in POSIX mode. Since POSIX says nothing about OSTYPE and its
brethren, implementations are free to do as they wish.
Chet
--
``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/