AIX, Linux and POWER Portal

AIX => Administration => Topic started by: Michael on November 26, 2019, 07:40:37 AM

Title: What ksh shell (version) am I using?
Post by: Michael on November 26, 2019, 07:40:37 AM
The default shell on AIX is /usr/bin/ksh, and it's version is, by definition ksh88 (POSIX norm).

Several other shell behaviors are emulated by this binary based on the program (argv[0]) name - via hard-links.

Code: [Select]
root@x064:[/home/root]find /usr -inum 603 -xdev -ls
  603  289 -r-xr-xr-x  5 bin       bin         294926 Nov 29  2017 /usr/bin/ksh
  603  289 -r-xr-xr-x  5 bin       bin         294926 Nov 29  2017 /usr/bin/psh
  603  289 -r-xr-xr-x  5 bin       bin         294926 Nov 29  2017 /usr/bin/rksh
  603  289 -r-xr-xr-x  5 bin       bin         294926 Nov 29  2017 /usr/bin/sh
  603  289 -r-xr-xr-x  5 bin       bin         294926 Nov 29  2017 /usr/bin/tsh

There is a second ksh version named ksh93.

Code: [Select]
find /usr -inum 91 -xdev -ls
   91 2250 -r-xr-xr-x  2 bin       bin        2303098 Nov 14  2017 /usr/bin/ksh93
   91 2250 -r-xr-xr-x  2 bin       bin        2303098 Nov 14  2017 /usr/bin/rksh93

This version supports additional options that ksh(88) does not.

I further recommend reading: https://en.wikipedia.org/wiki/KornShell - for history, and the AIX documentation (currently) at:

Finally, I also noticed this discussion on ksh and ksh93: https://unix.stackexchange.com/questions/199900/how-can-i-safely-get-the-version-of-ksh