home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!destroyer!ncar!mimbres.cs.unm.edu!cs.sandia.gov!jhgreen
- From: jhgreen@cs.sandia.gov (Jethro H. Greene)
- Subject: Re: shell identification from within the shell
- Message-ID: <1993Jan16.044319.2819@cs.sandia.gov>
- Sender: usenet@cs.sandia.gov (Another name for news)
- Organization: Sandia National Laboratories, Albuquerque, NM
- References: <1993Jan16.005308.17131@eng.ufl.edu>
- Date: Sat, 16 Jan 93 04:43:19 GMT
- Lines: 32
-
- In article <1993Jan16.005308.17131@eng.ufl.edu> ruck@delta.ee.ufl.edu (John R Ruckstuhl Jr) writes:
- >(1) How does one test whether one's running "sh", "ksh", or "bash" (and
- > other Bourne-ish shells)?
- >
- > I am using:
- > shellflavor=sh # assume Bourne shell until proven otherwise
- > if [ "$BASH_VERSION" ]; then
- > shellflavor=bash
- > fi
- > to differentiate between the Bourne shell and bash, but I don't know
- > what's unique about the Korn shell.
- >
- > On an HP-UX 7.0 B 9000/375, I look at the ksh man-page and it seems
- > to say that "SHELL" will be set automatically when one runs ksh.
- > But it seems that if the ksh's parent shell has exported some value
- > (like /usr/local/bin/tcsh) then the ksh's shell will have
- > SHELL=/usr/local/bin/tcsh still.
- >
- >
- >(2) How does one test whether one's running "csh" or "tcsh" ?
- >
- > I am using:
- > set shellflavor = `basename $shell`
- >
- >
- 'ps' would give you the information.
-
- --
- Jethro H. Greene
- Massively Parallel Computing Research Laboratory,
- Sandia National Laboratories, Albuquerque, New Mexico
-
-