korn shell version at runtime?

How can I check what kornshell version I am using at runtime from within a kornshell script?

Right now, the world is divided into ksh88 and ksh93. You could look at the variable SECONDS to see if it is an integer or not. If it's an integer you're in ksh88. If it has a decimal point, you're in ksh93.

Starting with ksh93, you can use ${.sh.version} to see which ksh version you are using. But that won't work in ksh88. And ksh88 is the most common version in use.

Thanks, I can use that to get a final version.

And then there's pdksh - think of it as a broken implimentation of ksh...
pdksh sets the variable $KSH_VERSION...
If you're on a "free" system (Linux, possibly BSD as well), you will have this instead of the real ksh, due to the license.

I always install the real ksh though, since it works better.