[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bash clobbers variables that is shouldn't

From: aric
Subject: Bash clobbers variables that is shouldn't
Date: Thu, 12 Oct 2000 16:32:19 -0400

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' 
-D_FILE_OFFSET_BITS=64  -I.  -I. -I./include -I./lib -I/usr/include -O2 
-march=i386 -mcpu=i686
uname output: Linux radar.eng.fore.com 2.2.16-22 #1 Tue Aug 22 16:49:06 EDT 
2000 i686 unknown
Machine Type: i386-redhat-linux-gnu

Bash Version: 2.04
Patch Level: 11
Release Status: release

The Bourne shell does not define $OSTYPE. Bash does, but when invoked as
/bin/sh, bash tries to be as mush like the Bourne Shell as possible.
Therefore, when invoked as /bin/sh, bash should not clobber OSTYPE. This
goes for other variables that bash defines, too.  Earlier versions of
bash did not clobber OSTYPE like 2.04 does.

    % echo $OSTYPE
    % /bin/sh -c 'echo $OSTYPE'

    If invoked as /bin/sh, don't clobber any environment variables
except those that the Bourne Shell does.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]