REDUX: How to overcome an incompatibility between the ksh on Linux vs. that installed on AIX/Solaris/HPUX?

I have uncovered another problem in the effort that we are making to port several hundreds of ksh scripts from AIX, Solaris and HPUX to Linux. See here for the previous problem.

This code:

#!/bin/ksh
if [ -a k* ]; then
    echo "Oh yeah!"
else
    echo "No way!"
fi
exit 0

(when run in a directory with several files whose name starts with k) produces "Oh yeah!" when called with the AT&T ksh variants (ksh88 and ksh93). On the other hand it produces and error message followed by "No way!" on the other ksh variants (pdksh, MKS ksh and bash).

Again, my question are:

  • Is there an environment variable that will cause pdksh to behave like ksh93? Failing that:
  • Is there an option on pdksh to get the required behavior?

Answers


I wouldn't use pdksh on Linux anymore. Since AT&T ksh has become OpenSource there are packages available from the various Linux distributions. E.g. RedHat Enterprise Linux and CentOS include ksh93 as the "ksh" RPM package.

pdksh is still mentioned in many installation requirement documentations from software vendors. We replaced pdksh on all our Linux systems with ksh93 with no problems so far.


Need Your Help

How to create a powershell extension for my app

c# powershell

I'm developing a platform and because it has a lot of configurations and parameters I thought that it would be very nice to allow System Administrator to script tasks and stuff like that, just like

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.