home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / shell / 5227 < prev    next >
Encoding:
Text File  |  1993-01-03  |  1.7 KB  |  41 lines

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