use .sh.version in a numeric context and it is automatically converted to a 
YYYYMMDD integer

        print $(( .sh.version ))
        if (( .sh.version > 20000101 )) ...

.sh.version has had this format since Version M 93s+ 2007-11-27
and .sh.version in a numeric context has been in place since 20081008

we'll update the ksh FAQ to describe .sh.version in detail

On Tue, 17 Jan 2012 22:28:52 +0800 Clark J. Wang wrote:
> I have 4 versions of ksh93 at hand and following are all the ${.sh.version}
> strings:

> Version M 1993-12-28 p
> Version M 93t 2008-11-04
> Version JM 93u 2011-02-08
> Version jM 93u 2011-02-08

> And I remember (not quite sure) I've ever seen one version like 93q+.

> For new ksh users like me it seems to be a bit difficult to understand what
> `JM' means and what's the difference between `JM' and `jM'. And I don't
> know which one of `JM' and `jM' is newer. To write a kshrc which can work
> for all ksh versions I have to check the ${.sh.version} string but the
> format is not consistent and it's not as easy to parse and compare. So is
> it possible to use a more readable version string? Or we can introduce a
> new var like Bash's ${BASH_VERSINFO[@]}?

_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to