Subject: sh(1), `export' and the environment (was Re: Odd sh(1) behavior wrt $TERM)
To: Nathan Dorfman <>
From: Nathan Dorfman <>
List: current-users
Date: 01/21/2002 13:54:36
On Mon, Jan 21, 2002 at 11:49:39AM -0500, Nathan Dorfman wrote:
> $ TERM=xterm; export TERM
> $ echo $TERM
> xterm
> $ set -E
> No entry for terminal type "xterm-color";
> using dumb terminal settings.
> $

Looking over the sh/libedit source, it seems to me that rather than 
changing its own environment, the shell maintains its own list of
'exported' variables to place in the environment of new processes...

libedit, however, calls getenv("TERM") in the original process,
which gives it back the original (broken) value.

Does anyone have any thoughts/comments on this? The current behavior
seems rather broken to me, does anyone disagree?

"Just because a few of us can read and     \  \  \\   Nathan Dorfman
write and do a little math, that doesn't    \     \\
mean we deserve to take over the universe."  \  \  \\   PGP Key 0832DB12