[comp.unix.questions] how do I best re-execute a ksh script

jon@jonlab.UUCP (Jon H. LaBadie) (12/01/89)

I'm putting together a shell script that initializes some conditions
and then places the user into an interactive shell (ksh).  The users
"should" exit at the end of the session, but I suspect that many will
attempt to "reexecute the same program".  The effect of this is a
stacking of shells, most sleeping.  I'm looking for optimal ways to
avoid this stacking.

Currently, I am considering aliasing the original script name into a
name that "execs" the real script.  However, the script entails
considerable overhead during initialization.  I would like to eliminate
this overhead on subsequent "re-invocations".  I.e.  I would like to
reenter my shell script in the middle.

One possible avenue to explore is the "ENV" file.  Currently, my script
copies the users "ENV" file to a new name and adds a few items to it.
The ENV parameter is reset to the new file before the interactive script
is invoked.  Thus, additions to this file would be trivial to introduce.

Just one of the many possibilities.  Any thoughts on alternatives?

Jon

-- 
Jon LaBadie
{att, princeton, bcr}!jonlab!jon
{att, attmail, bcr}!auxnj!jon