home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / shell / 5507 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.5 KB  |  44 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!destroyer!ncar!mimbres.cs.unm.edu!cs.sandia.gov!jhgreen
  3. From: jhgreen@cs.sandia.gov (Jethro H. Greene)
  4. Subject: Re: shell identification from within the shell
  5. Message-ID: <1993Jan16.044319.2819@cs.sandia.gov>
  6. Sender: usenet@cs.sandia.gov (Another name for news)
  7. Organization: Sandia National Laboratories, Albuquerque, NM
  8. References: <1993Jan16.005308.17131@eng.ufl.edu>
  9. Date: Sat, 16 Jan 93 04:43:19 GMT
  10. Lines: 32
  11.  
  12. In article <1993Jan16.005308.17131@eng.ufl.edu> ruck@delta.ee.ufl.edu (John R Ruckstuhl Jr) writes:
  13. >(1) How does one test whether one's running "sh", "ksh", or "bash" (and
  14. >    other Bourne-ish shells)?
  15. >
  16. >    I am using:
  17. >        shellflavor=sh        # assume Bourne shell until proven otherwise
  18. >        if [ "$BASH_VERSION" ]; then 
  19. >            shellflavor=bash
  20. >        fi
  21. >    to differentiate between the Bourne shell and bash, but I don't know
  22. >    what's unique about the Korn shell.
  23. >    
  24. >    On an HP-UX 7.0 B 9000/375, I look at the ksh man-page and it seems 
  25. >    to say that "SHELL" will be set automatically when one runs ksh.
  26. >    But it seems that if the ksh's parent shell has exported some value
  27. >    (like /usr/local/bin/tcsh) then the ksh's shell will have
  28. >    SHELL=/usr/local/bin/tcsh still.
  29. >
  30. >
  31. >(2) How does one test whether one's running "csh" or "tcsh" ?
  32. >
  33. >    I am using:
  34. >        set shellflavor = `basename $shell`
  35. >
  36. >
  37. 'ps' would give you the information.
  38.  
  39. -- 
  40. Jethro H. Greene
  41. Massively Parallel Computing Research Laboratory,
  42. Sandia National Laboratories, Albuquerque, New Mexico
  43.  
  44.