Ksh93 on Linux compatible with ksh93 on AIX

Hi Experts,

I have several shell scripts that have been developed on a Linux box for korn ksh93.

If we want to run this software on an AIX 6.1 box that runs ksh88 by default can we just change the she-bang line to reference /bin/ksh93 which ships with AIX as its "enhanced shell" to ensure compatibility?

This is the korn shell versions on the AIX box:

ksh
set -o vi
Version M-11/16/88f

ksh93
set -o vi
Version M-11/16/93e

ksh version on our development server (default ksh on linux is linked to ksh93):

version         sh (AT&T Research) 93u+ 2012-08-01

Any input would be appreciated.

Thanks

K

Depends what these korn scripts do. Shell compatibility doesn't mean all the same commands are available.

yes I have considered the possibility that some programs or commands maybe different. Do you know of any automation tools that can examine shell scripts and list utilised commands and programs to make the analysis easier? There are about 25 scripts doing various functions mainly file system commands such as copying files, sed, invoking sqlplus, grep etc.....

Also, Linux/GNU versions of grep, sed, awk, etc have extended features which may not be compatible with AIX. If these features aren't used, that's OK.

You could have a look here:
ast/src/cmd/ksh93 at master * att/ast * GitHub (notably ast/RELEASE at master * att/ast * GitHub)

There is release information for the various version of ksh93. If any of the scripts use features from later releases (between ksh93f upto and including ksh93u+) then you may need to resolve those..

Hi, Keith.

Take a look at post 16 in thread http://www.unix.com/shell-programming-and-scripting/268856-how-pre-check-scrutinize-all-my-shell-scripts.html

I posted a perl script that may help you see what commands might be used in shell scripts. It is rough because it is an experiment. There is an example input shell script with the resulting output. The perl script, p1.txt, should be copied to a file p1 , add execution permission, then run it as shown in the example.

The perl script ran correctly in this environment:

aix 7.1.0.0
perl 5.10.1

Best wishes ... cheers, drl

Every recent AIX system has both a ksh88 and a ksh93 installed by default:

/usr/bin/ksh   -> system default, ksh 88
/usr/bin/ksh93 -> ksh 93 (t, i believe)

You haven't stated which TL of 6.1 you have installed, but i suppose having a version e it is pretty old. My suggestion is to update it to at least TL 9, if you can't update to a recent 7.1 for some reason. This not only will update the ksh 93 but also fix a pretty long list of APARs flagged HIPER (which means IBM wants you to update yesterday).

bakunin