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

Re: SEUL: Stopping dreams

řann 17-Feb-98 skrifar George Bonser:
> You have to be careful here, EVERY shell that exits will execute
> .bash_logout.
> You have to write the pid of the shell that started the session to a file and
> test the contents of that file (or the existance of the file of you make the
> name a function of the PID) on exit so only the shell that started the the
> session will kill it on exit. I know it is common sense but it is worth
> mentioning.
  That scheme isn't necessary, there should be an environment variable called
SHLVL (it's there in csh and tcsh), which tells the shell level you're in.  You
can check this level, to see if you're in at a startup or not.  The tricky
thing to remember is, that if you're running inside X, the .xsession script is
running at shell level 1, and all xterms at shell level 2.

Orn Einar Hansen                         oe.hansen@oehansen.pp.se
                                        voice+fax; +46 035 217194