*BSD News Article 47749


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.uwa.edu.au!classic.iinet.com.au!news.uoregon.edu!usenet.eel.ufl.edu!news.mathworks.com!newsfeed.internetmci.com!tank.news.pipex.net!pipex!howland.reston.ans.net!xlink.net!snert!not-4-mail
From: pmh@pilhuhn.de (Patrick M.Hausen)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: 2.0.5 pdksh - weird behavior concerning $ENV
Date: 1 Aug 1995 16:39:29 +0200
Organization: The Home Of The Pilhuhn
Lines: 48
Message-ID: <3vleb1$kdi@pilhuhn.pilhuhn.de>
NNTP-Posting-Host: pilhuhn.de

Hi all!

Since I'm a little schizophrenic with respect to SysV vs. BSD (I use
SysVR4 at work) I installed the pdksh as my login shell.

The I thought up a clever (so I think ;-) way of setting up a consistent
environment whether I login via xdm or at a terminal.

.xsession _and_ .profile set up things like PATH, MANPATH, that are needed
by all programs, not only the shell. Last in both files $ENV is defined
as $HOME/.kshrc where the setup for interactive shells is done.

There the usual eval `tset ... is called as well as stty erase ^h.

The funny thing: when I start, say, man ls in a shell window I get 
messages:

Erase set to delete.
Erase set to delete.
stty: TIOCGETD: Operation not supported

before the manpage appears and the terminal is still in cooked mode, so more
always waits for the Enter key.

I fixed the problem by putting a wrapper around my .kshrc:

case $i in
	*i*)     # check for interactive shell

        ...	 # all my .kshrc

        ;;
esac


OK. But what the ??? is happening here? Which process reexecutes .kshrc when
I type man ls? I mean, the shell forks --> no execution of anything. After
alias, environment, etc. substitution it searches for man in $PATH, which it 
finds in /usr/bin. Then /usr/bin/man is execed, which doesn't give a damn about
some environment variable called $ENV, so: who? when?


Paddy
-- 
Patrick M. Hausen    Gerwigstr. 11    76131 Karlsruhe    Tel. +49 721 699234
          pmh@pilhuhn.sub.org    s_hausen@ira.uka.de    IRC: cutie
"You can fool all of the people some of the time and some of the
 people all of the time, but you can't fool Mom." (Captain Penny's Law)