Discussions
Categories
- 17.9K All Categories
- 3.4K Industry Applications
- 3.3K Intelligent Advisor
- 63 Insurance
- 535.7K On-Premises Infrastructure
- 138.1K Analytics Software
- 38.6K Application Development Software
- 5.6K Cloud Platform
- 109.3K Database Software
- 17.5K Enterprise Manager
- 8.8K Hardware
- 71K Infrastructure Software
- 105.2K Integration
- 41.5K Security Software
ksh versus dtksh

Chris99999
Member Posts: 37
Hi
We are migrating from a SCO Unix system to Solaris 10. ( SunOS 5.10 Generic_144488-06 sun4v sparc SUNW,T5240)
There are 3 different versions of ksh
grep -i version /bin/ksh
@(#)Version M-11/16/88i
grep -i version /usr/bin/ksh
@(#)Version M-11/16/88i
grep -i version /usr/dt/bin/dtksh (Desktop environment for CDE Version)
@(#)Version M-12/28/93d
@(#)Version 12/28/93
@(#)Version M-12/28/93
We need to use /usr/dt/bin/dtksh as that 1993 version is what is used on the SCO Unix box and there are enough differences between that and the earlier 1988 version to make it necessary. All our scripts contain #!/bin/ksh or invoke the shell as /bin/ksh. There are so many I'd rather not change them (and for other reasons too)
My question is whether there is any problem with moving or linking /usr/dt/bin/dtksh into /bin so that /bin/ksh will execute the later version. i.e. Are there any dependencies in the installation on /bin/ksh being the 88 variant?
Thanks
Chris
We are migrating from a SCO Unix system to Solaris 10. ( SunOS 5.10 Generic_144488-06 sun4v sparc SUNW,T5240)
There are 3 different versions of ksh
grep -i version /bin/ksh
@(#)Version M-11/16/88i
grep -i version /usr/bin/ksh
@(#)Version M-11/16/88i
grep -i version /usr/dt/bin/dtksh (Desktop environment for CDE Version)
@(#)Version M-12/28/93d
@(#)Version 12/28/93
@(#)Version M-12/28/93
We need to use /usr/dt/bin/dtksh as that 1993 version is what is used on the SCO Unix box and there are enough differences between that and the earlier 1988 version to make it necessary. All our scripts contain #!/bin/ksh or invoke the shell as /bin/ksh. There are so many I'd rather not change them (and for other reasons too)
My question is whether there is any problem with moving or linking /usr/dt/bin/dtksh into /bin so that /bin/ksh will execute the later version. i.e. Are there any dependencies in the installation on /bin/ksh being the 88 variant?
Thanks
Chris
Answers
-
As far as I know, Solaris 10 has a default Bourne Shell /sbin/sh, not ksh88. Solaris provides ksh93 in the form of dtksh (/usr/dt/bin/dtksh). dtksh is based on ksh-93 with X Toolkit Intrinsics (Xt) and Motif bindings, so that you can write Motif GUIs in ksh.
For what it's worth, ksh-93 is backwards compatible with ksh-88 beside a few exceptions:
• Variables in functions declared with the "name()" syntax are no longer local.
• ksh-93 does not set the ERRNO environment variable.
• Testing for string equality via the "=" operator is supported, but obsolete. Instead, use "==".
• The "-x" option to alias is no longer supported.
• The "-f" option to typeset is no longer supported.
• The output formats of some built-in functions including set, typeset, and alias has changed. -
Thanks for your answer. Our systems people are worried about the impact to the system if we link /bin/ksh to dtksh.
If Bourne is the default, and as this is a standard VM Solaris 10 build, I can't see any impact? -
You should be fine linking /bin/ksh (acutally /usr/bin/ksh). Just leave /sbin/sh alone.
-
So this works on ksh 88 on Sol 10 but not on dtksh
if [[ -s filename ]] then
if [[ -s filename ]] ; then
works on both
This discussion has been closed.