ksh version

Hi,

I am running Suse Linux 12.1 and I am using ksh. How do i get to know which ksh it is, ksh 88 or ksh93 ?

# echo $KSH_VERSION
echo $KSH_VERSION
@(#)LEGACY KSH R50 2014/06/29 openSUSE
#

running the above command gives some information but how do I know if it is ksh88 or 93 ?

Thanks.

Hello alltaken,

Could you please try following and let me know if this helps you.

strings /bin/ksh | grep Version | tail -2
OR
ksh --version

Thanks,
R. Singh

Hi,
I already tried them. Below is the output:

# strings /bin/ksh | grep Version | tail -2
strings /bin/ksh | grep Version | tail -2
# ksh --version
ksh --version
ksh: ksh: --: unknown option
#

Thanks

How about :

strings $(which ksh) | grep Version

If the substring operator works, i.e. ${VAR:1:2} then it's not ksh88.

I believe this shell is lksh LEGACY KSH which is built on MIRBSD KSH and is intended exclusively for running legacy shell scripts. It is not really intended as a login script and there is no explicit support for interactive use, nor any command line editing or history code.

Does your system have mksh as well? If so this would be a much closer match to ksh93 although date arithmetic is not supported.

As an addendum to Corona688's reply...

'ksh88' does NOT have the -t option for the read statement.

Yes, the system has mksh as well. Actually I have some aix scripts, ksh and ksh93. They are kept in separate directories, I am guessing the ksh scripts are ksh88 and ksh93 are obviously 93 as I can see ksh93 with the hash bang. Unfortunately, I do not know which version of AIX had these scripts otherwise I could have guessed the default ksh for that version of AIX.
Also, I have to port these scripts to bash on suse linux. Would that be pesky ?

Thanks.