I am attempting to capture the version programmatically, not interactively (for
ksh88, seems to be the only way). I ran the following test on the boxes I have
access to. I don't have access to the one box with ksh93e that some of the SAs
use. Many don't have the 'what' command. Interesting what some systems return
and others don't. Also interesting, none returned data for all methods.
1 - print ${KSH_VERSION}
2 - what $( which ksh ) | grep -i version
what $( which ksh93 ) | grep -i version
3 - print ${.sh.version}
4 - ksh —version
ksh93 --version
5 - ESC CTRL-V
# ---------- ---------- ----------
uname -psrv # AIX 3 5 powerpc
which ksh # /usr/bin/ksh
1 <null>
2 <null>
3 <null>
4 <null>
5 Version M-11/16/88f
which ksh93 # /usr/bin/ksh93
1 <null>
2 Version M-12/28/93e
3 Version M-12/28/93e
4 --version: bad option(s)
5 Version M-12/28/93e
# ---------- ---------- ----------
uname -psrv # Linux 2.6.18-92.1.6.el5
# Linux 2.6.18-92.1.10.el5
which ksh # /usr/bin/ksh93 -> /bin/ksh
1 <null>
2 ksh93: what: not found
3 Version M 1993-12-28 r
4 version sh (AT&T Labs Research) 1993-12-28 r
5 Version M 1993-12-28 r
# ---------- ---------- ----------
uname -psrv # Linux 2.6.9-55.0.18.0.1.ELsmp
# Linux 2.6.18-164.2.1.el5
which ksh # /usr/bin/ksh
1 @(#)PD KSH v5.2.14 99/07/13.2
2 ksh: what: not found
3 ksh: : bad substitution
4 ksh: --: unknown option
5 PD KSH v5.2.14 99/07/13.2
# ---------- ---------- ----------
uname -psrv # Linux 2.6.18-164.2.1.el5PAE
which ksh # /bin/ksh -> /bin/ksh93
1 <null>
2 /bin/ksh: what: not found
3 Version M 93s+ 2008-01-31
4 version sh (AT&T Research) 93s+ 2008-01-31
5 Version M 93s+ 2008-01-31
# ---------- ---------- ----------
uname -psrv # Linux 2.6.18-274.7.1.el5
which ksh # /bin/ksh -> /bin/ksh93
1 Version AJM 93t+ 2010-02-02
2 ksh: what: not found
3 Version AJM 93t+ 2010-02-02
4 version sh (AT&T Research) 93t+ 2010-02-02
5 Version AJM 93t+ 2010-02-02
# ---------- ---------- ----------
uname -psrv # Linux 2.6.38-8-generic #42-Ubuntu
which ksh # /usr/bin/ksh -> /bin/ksh93
1 Version JM 93t+ 2010-06-21
2 ksh93: what: not found
3 Version JM 93t+ 2010-06-21
4 version sh (AT&T Research) 93t+ 2010-06-21
5 Version JM 93t+ 2010-06-21
# ---------- ---------- ----------
uname -psrv # Darwin 10.8.0
which ksh # /bin/ksh93 -> /bin/ksh
1 <null>
2 $Id: Version M 1993-12-28 s+ $
3 Version M 1993-12-28 s+
4 version sh (AT&T Research) 1993-12-28 s+
5 Version M 1993-12-28 s+
# ---------- ---------- ----------
uname -psrv # SunOS 5.9 Generic_122300-07 sparc
which ksh # /usr/bin/ksh
1 <null>
2 Version M-11/16/88i
3 ksh: ${.sh.version}: bad substitution
4 <null>
5 Version M-11/16/88i
which ksh93 # /usr/bin/ksh93 -> /usr/local/bin/ksh.2007-03-28.sol9.sun4
1 <null>
2 $Id: Version M 1993-12-28 s+ $
3 Version M 1993-12-28 s+
4 version sh (AT&T Research) 1993-12-28 s+
5 Version M-11/16/88i # <- NOTE: Same as ksh88 !
# ---------- ---------- ----------
uname -psrv # UWIN-XP 4.5/5.1 2010-06-08 i686
which ksh # /usr/bin/ksh.exe
1 Version JM 93t+ 2010-05-24
2 /usr/bin/ksh:
3 Version JM 93t+ 2010-05-24
4 version sh (AT&T Research) 93t+ 2010-05-24
5 Version JM 93t+ 2010-05-24
--
Eric D Peterson, Software Development Engineer (SDE)
RealNetworks, Inc. http://www.real.com
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users