Re: How do I detect which shell (ksh, bash, csh, zsh, tcsh) is currently used?

From: Dave Brown (dhbrown_at_hobbes.dhbrown.net)
Date: 12/28/04


Date: Tue, 28 Dec 2004 04:56:06 GMT

In article <cqpme6$80c$01$1@news.t-online.com>, Carl Minter wrote:
> Imagine I have an open x-term. Now I want to detect which shell is currently used.
> How do I find this out?

You can use "echo $0", although it may not tell the real story... for
instance, there's a "pdksh" which is often installed as "ksh", and isn't
a genuine Korn shell. (And I believe some systems install "tcsh" as
"csh".

For Korn shell, you can tell if it's genuine if you:
   set -o vi
   <Esc> <Ctrl-V>
you should see:
   Version M 1993-12-28 n+
or something like that. (Which would identify it at "ksh93" instead of
the venerable but still common "ksh88".)

-- 
Dave Brown  Austin, TX


Relevant Pages

  • Re: Linux users seeks some freeBSD pointers
    ... Speaking of Korn shell, I'll repost on old story (or ... Unix style scripting and shell services on NT for compatibility ... This assertion and counter assertion went back and forth for ...
    (comp.unix.bsd.freebsd.misc)
  • Re: korn 93 for ubuntu edgy
    ... If it turns up no hits on korn then does it mean no Korn shell package ... Looks like there is a version for edgy in universe (which may not be enabled ...
    (Ubuntu)
  • Re: what does this syntax mean
    ... Only very early versions of the Bourne shell used an external ... The Korn shell never has. ... The only POSIX shell that does not support it, ... Command lines, whether the command is builtin or external, undergo ...
    (comp.unix.shell)
  • SUMMARY: replacing the Bourne shell with the Korn shell
    ... I would want to replace the Bourne shell executables in the first place. ... between the Korn shell and the Bourne shell that could cause scripts ...
    (SunManagers)
  • CRON - Strange behavior
    ... We have a C++ program that is started using a korn shell wrapper ... This wrapper script is being run as a CRON job. ...
    (comp.unix.solaris)