ksh and bash have borrowed heavily from each other, so there are a large number of features with identical or nearly-identical syntax, but they aren't completely the same.
For true portability (or at least the greatest chance for it), you need to keep your scripts to the POSIX specification. ksh, bash, and most other shells of bourne descent attempt to be posixly-compliant, and will run scripts in posix mode if a #!/bin/sh
shebang is used. (Note however that this doesn't necessarily mean that they will reject non-posix syntax; it only ensures that a posixly-compliant script will
The above link is just the first version I found online. I suggest checking with your system's actual documentation. The next page is focused on bash and its extensions, but it also does a pretty good job summarizing what does and does not comprise posix syntax:
Note too that many of the core utilities like sed
also have both posix-defined features and non-posix extensions, with the implementations on different platforms supporting different things. The gnu utilities used on Linux in particular have a large number of extensions not found elsewhere. You need to read the documentation carefully of all the tools you use and only choose the posix and/or cross-system options.
Edit: Just to make sure you know all your options:
1) Install bash on AIX, write all of your scripts with bash syntax, and run them with #!/bin/bash.
2) Install ksh on Linux, write all of your scripts with ksh syntax, and run them with #!/bin/ksh.
3) Write all of your scripts with posix-compliant syntax, and run them on either system using #!/bin/sh.
*) Whatever option you choose, be sure to check the options and syntax of all the external commands involved to ensure only cross-platform features are used.