home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!spool.mu.edu!umn.edu!csus.edu!netcom.com!gary
- From: gary@netcom.com (Gary Messenbrink)
- Subject: ?Determine shell from withing a program?
- Message-ID: <1993Jan3.052413.22316@netcom.com>
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
- Distribution: us
- Date: Sun, 3 Jan 1993 05:24:13 GMT
- Lines: 30
-
- Hi again,
- When I asked this question before, I apparently did not give
- enough background information. I have a program that
- outputs a string that is to be executed by a shell. It
- currently works only for ksh. An example follows.
- eval `program`
- This causes program to execute and produce a string which
- then gets passed to the shell for processing.
- The problem is that I do not know how to determine what shell
- was usedto invoke the eval command. The program is to be
- distrbuted to other machines on a network where it will not be
- possible for me to enforce what shell is in use. I do not want
- to have a difference version of the program for each shell.
-
- Several people have suggested using a variable called SHELL, but
- it is non-standard and even where it is used, it is very easy
- to cause strange results. For example, if the variable is
- set to KSH when running ksh and one enters csh, the c shell
- is started but the value of SHELL is still KSH.
-
- Sorry this got so long. I really appreciate the responses
- received to date. If anyone has any other ideas, please post
- or email.
-
- Thanks again,
- Garyi
- --
- ========================================================================
- | Gary Messenbrink gary@netcom.com [192.100.81.100] |
- ========================================================================
-