How to identify ancient KornShell version?

5,262

Solution 1

CTRL+ALT+V

or

ESC, CTRL+V

This was discovered on a related question on the Unix & Linux SE:

How can I safely get the version of ksh? - Unix & Linux Stack Exchange

This revealed that we are running

Version M-11/16/88f

Maybe it's not that ancient after all!

Solution 2

Try what $(which ksh)

For example, on a Solaris 8 box:

$ what $(which ksh)
/usr/bin/ksh:
        Version M-11/16/88i
        SunOS 5.8 Generic 110662-24 Apr 2007
Share:
5,262

Related videos on Youtube

JonathanDavidArndt
Author by

JonathanDavidArndt

This person prefers to keep an air of mystery about them.

Updated on September 18, 2022

Comments

  • JonathanDavidArndt
    JonathanDavidArndt almost 2 years

    We had a guy retire on us, and the documentation left behind is a little on the light side. Need a little help identifying and using part an older client-server system.

    The server itself is maintained by several excellent Unix admins. We are currently running AIX 7.1.0.0 on the server side.

    However, when we log in using the proprietary SSH client, we are greeted with a shell that looks familiar, but is strange in other ways. The shell itself seems to be KornShell:

    echo $0
    -ksh
    

    But the shell doesn't respond to normal shell commands (cannot tap up/down to recall recent commands, cannot backspace normally, no auto-complete with tab, etc.)

    Recent commands are recalled using ESC + k

    If the ESC key is tapped, the terminal stops responding to input until i, a, s, or cc are pressed (or k, as already mentioned brings up the most recent command).

    To edit a recalled command we have to tap SHIFT + UP

    Backspace is actually the RIGHT arrow, and to clear a typed command we have to hit SHIFT + RIGHT

    The whence command is not available, and none of the techniques to discover the KSH version on this page worked.

    Someone in our office suggested this is some kind of inline vi.

    Does anyone else have any advice? Is there any documentation available?

    • Vijay Anand Mareddy
      Vijay Anand Mareddy over 6 years
      probably a combination of set -o vi (you can get back with set -o emacs) and some incorrectly set $TERM variable (not matching the terminal emulation emulated by your SSH client).
    • JonathanDavidArndt
      JonathanDavidArndt over 6 years
      @mihi This does favorably change the way the shell responds. Still having trouble figuring out how recent commands can be recalled (the Up arrow is not working), but at least the backspace key works normally.
    • jrw32982
      jrw32982 over 6 years
      You should check out ~/.profile, ~/.kshrc, /etc/profile and the value of $ENV. Also read the man page for ksh. You will then find where set -o vi is being run among many other things.
  • JonathanDavidArndt
    JonathanDavidArndt over 6 years
    For this, I get a huge, vomitous mass of information, 40+ lines long, mostly .c libraries. At the very end, there is an entry for vi.c, cmdksh, aix71B 1040A_71B followed by a datestamp from the year 2010.
  • foxfabi
    foxfabi over 6 years
    search through the spew for the 88 or 93 to see if you can narrow down the ksh version.
  • foxfabi
    foxfabi over 6 years
    And, I just had the same thought as mihi above: set -o emacs
  • JonathanDavidArndt
    JonathanDavidArndt over 6 years
    Really want to accept this answer. You still get my upvote. Even though this did not directly solve the problem, it still was extremely helpful. The command suggested actually works -- unlike many of the other suggestions around the webs. Thank you. You are a gentleman and a scholar.
  • JonathanDavidArndt
    JonathanDavidArndt over 6 years
    As it turns out, your friendly Unix admins can install an up-to-date version of bash on AIX 7.1 by request. ksh is dead; long live ksh~