Ksh93 on Linux compatible with ksh93 on AIX


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Ksh93 on Linux compatible with ksh93 on AIX
# 1  
Old 10-20-2016
Code 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:

Code:
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):
Code:
version         sh (AT&T Research) 93u+ 2012-08-01

Any input would be appreciated.

Thanks

K


Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 10-20-2016 at 08:23 AM.. Reason: Added CODE tags.
# 2  
Old 10-20-2016
Depends what these korn scripts do. Shell compatibility doesn't mean all the same commands are available.
# 3  
Old 10-20-2016
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.....
# 4  
Old 10-20-2016
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.
# 5  
Old 10-20-2016
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..
# 6  
Old 10-21-2016
Hi, Keith.
Quote:
Originally Posted by Keith Turley
y ... 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.....
Take a look at post 16 in thread How to pre-check scrutinize all my shell scripts?

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:
Code:
aix 7.1.0.0
perl 5.10.1

Best wishes ... cheers, drl

Last edited by drl; 10-21-2016 at 12:24 PM..
# 7  
Old 10-22-2016
Every recent AIX system has both a ksh88 and a ksh93 installed by default:

Code:
/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

Last edited by bakunin; 10-22-2016 at 02:44 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Ksh93/AIX compatibility

Hi everyone ! Im trying to know from wich version of AIX KSH93 is available ? Internet tell me 6.x and 7.x AIX are available, bue what about 5.x ? Is KSH93 available on AIX 5.x ? Is it the same way to manipulate variables as KSH93 on 7.x ? Thanks for your support and have a nice day ! (2 Replies)
Discussion started by: majinfrede
2 Replies

2. Shell Programming and Scripting

Possible ksh93 Bug Expanding Variables?

My OS is Linux (kernel 4.08.something) and AIX (7100-04-01-1543), the used ksh versions are: ksh88: Version M-11/16/88f (AIX) ksh93: Version M 93t+ 2009-05-01 (AIX), Version M 93u (Linux) When writing a parser for stanza files in ksh i encountered a rather strange behavior. Here is a... (4 Replies)
Discussion started by: bakunin
4 Replies

3. UNIX for Advanced & Expert Users

Embed tcl in ksh93 script

Hello everyone, I am trying to embed some tcl code inside a ksh93 script but I am not having any success. I even tried the simplest of code, something like this: . . jk=$(echo $(tcl << | write_file junkme "test"' | )) just to see if a file gets written. When I run there are no errors, but ... (3 Replies)
Discussion started by: gio001
3 Replies

4. Shell Programming and Scripting

ksh93 different results using -x option

This problem seems to be specific to ksh93. If you run with set -x some scripts don't work properly. For example: $ cat ksh.test2 ] && print FUBAR! || print OK! $ $ /bin/ksh93 ksh.test2 OK! $ /bin/ksh93 -x ksh.test2 + ] + print FUBAR! FUBAR! $ Trying to find out why this is... (8 Replies)
Discussion started by: lthorson
8 Replies

5. UNIX for Dummies Questions & Answers

ksh93 newline character problem

Hi , I am working on Linux, with ksh93 installed. The following statement echo \\n just prints \n on this shell. However on pdksh echo \\n gives a blank new line as a output. What is the correct way of printing a new line character on the ksh93? (4 Replies)
Discussion started by: neeto
4 Replies

6. UNIX for Advanced & Expert Users

Install ksh93 for cygwin

Hi, Does anyone know where can I get ksh93 for installation on CYGWIN. Thanks? (1 Reply)
Discussion started by: devtakh
1 Replies

7. Shell Programming and Scripting

Performance degradation with KSH93

Hi, I have a script that calls an external program to perform some calculations and then I read with "grep" and "sed" values from the output files. I've noticed that performance of KSH93 degrades with every iteration. The output files are all the same size, so I don't understand why after the... (2 Replies)
Discussion started by: i.f.schulz
2 Replies

8. Shell Programming and Scripting

ksh88 or ksh93

Hi all! Does anybody know how can I check if any UNIX installation has implemented ksh88 or ksh93? Thanks in advance. Néstor. (3 Replies)
Discussion started by: Nestor
3 Replies

9. Shell Programming and Scripting

ksh93 deprecation...

Any means of running ksh93 in a ksh88-mode? Might sound odd, but I want/need to restrict U/Win-developed scripts to correspond to the ksh88 version on my Solaris environment(s). Thanks. (2 Replies)
Discussion started by: curleb
2 Replies

10. Shell Programming and Scripting

Strange array handling in ksh93

I wrote a script in ksh93 (the OS is AIX 5.2, ML7), which failed to run. After some testing i found out why, but the answer is a bit dissatisfying. Look for yourself: #!/bin/ksh93 # --------- Step Names typeset achStepName="foo" typeset achStepName="bar" typeset achStepName="fubar"... (3 Replies)
Discussion started by: bakunin
3 Replies
Login or Register to Ask a Question