Sponsored Content
Top Forums Shell Programming and Scripting AIX UNIX (kshell) to Linux Shell Script Migration. Post 302906122 by Kibou on Tuesday 17th of June 2014 09:43:21 AM
Old 06-17-2014
If you want to make your scripts work in bash, I am currently doing a migration from AIX to RHEL and we've found these issues:

- Variables in AIX inside a test can be without a preceding "$". (This won't work in Linux, so you have to insert a "$" before each variable in a test. Another solution is duplicate "[[" instead of leaving "[ ]" for your test.)

- Depends on the code, in my case I have found lots of variables comparing strings without being between double quotes, so we have decided to put double quotes for all variables comparing strings.

- You have to change the extension of your scripts that are .ksh into .sh. Be aware that you have to modify all your cronjobs and all your scripts that are being called by other applications (like Control-M) if you still want them to function as they did.

- You have to change the shebang for #!/bin/bash or #!/bin/sh or #!/usr/bin/env sh
I don't know which Linux distribution, but be aware of sh and dash for Debian/Ubuntu.

- You have to change the path for commands like, I had something like this in AIX:

/usr/bin/fuser

and now it has to be changed into

/bin/fuser

Same for mailx.

- We also had to look for all the executables in C and make sure it all works as they used to.

- We also searched all the sqlplus calls to test all the database related things.

- We had to find out a way to have which script depends on another script and which scripts are the parent scripts.

- We used sh -x to execute each script to search for anything strange or any possible errors.

- We made a copy of each script and then we commented each loop and test so we could execute each action of the script and see if any errors came.

- tail -n +2 but without -n doesn't work in Linux.

- We have found a few variables that were not declared and this was because someone forgot to change it in an old migration they did from HP-UX to AIX.

- Be aware of the environment variables.

- We created the whole structe in the new machine, first without caring about permissions.

I can give you more details in private.

Regards.
This User Gave Thanks to Kibou For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SCO UNIX to Linux migration

hi all i m working in a company ...and i have to migrate a C application running on SCO-UNIX to Red hat linux. can anybody tell me what is the difference between C commands and shell scripting on SCO-UNIX and LINUX. best regards harsh (3 Replies)
Discussion started by: vickey
3 Replies

2. Shell Programming and Scripting

callint Kshell script from bash default shell

I am trying to set some environment variables in a shell script which is written in Kshell. I am invoking this script in .profile. The problem is envirnment variables are set within the script but after exiting the script those are gone. I don't have any problem with If I have Kshell as my default... (0 Replies)
Discussion started by: roopla
0 Replies

3. UNIX for Advanced & Expert Users

script migration from HP-UX to AIX

Dear All, What points should i keep in mind while migrating scripts from HP-UX to AIX. Are there any notes available for this? cheers, vishal (1 Reply)
Discussion started by: vishal_ranjan
1 Replies

4. UNIX for Advanced & Expert Users

Migration of C Apps from AIX to LINUX

Hi All, I am currently facing new problem of migrating C(c language) application from AIX machine to Linux machine. We are using GCC to compile the source code.. But facing with the compilation issues, with lot of GCC C libs differing between AIX box to Linux box... Pls help me... (1 Reply)
Discussion started by: karthikc
1 Replies

5. Programming

Migration of C Apps from AIX to LINUX

Hi All, I am currently facing new problem of migrating C(c language) application from AIX machine to Linux machine. We are using GCC to compile the source code.. But facing with the compilation issues, with lot of GCC C libs differing between AIX box to Linux box... Pls help me... (1 Reply)
Discussion started by: karthikc
1 Replies

6. Red Hat

Print server Migration from AIX to Linux

Hi, Can anyone help me on migration the print server from AIX to RHEL 4? Appreciate your help? (1 Reply)
Discussion started by: brby07
1 Replies

7. Shell Programming and Scripting

Shell scripts migration from HP-Unix 11 to Red Hat Linux

We are changing our OS from HP-Unix 11 to Linux Red Hat. We have few k- shell, c - shell and sql scripts which are currently running under HP-Unix 11. Will these scripts work on LINUX as it is? or we need to do any code changes?IS there anyone who have done this kind of migration before?Thanks for... (2 Replies)
Discussion started by: Phoenix2
2 Replies

8. Shell Programming and Scripting

UNIX to Linux Migration

We have certain number of scripts that run on AIX server using ksh. Now that we migrate these scripts to Linux servers. We need to know what are the changes that we have to perform in script to make it compatible to run on Linux. Say like in our Unix -AIX "print" command worked. But that did... (6 Replies)
Discussion started by: SIva81
6 Replies

9. AIX

AIX - FC Switch migration, SAN Migration question!

I'm New to AIX / VIOS We're doing a FC switch cutover on an ibm device, connected via SAN. How do I tell if one path to my remote disk is lost? (aix lvm) How do I tell when my link is down on my HBA port? Appreciate your help, very much! (4 Replies)
Discussion started by: BG_JrAdmin
4 Replies

10. Linux

AIX 6.1 to Linux 7.2 migration

Hi, recently we have migrated our current AIX server to Linux, we have lot of shell script, few of them are FTP scripts. we have copied the complete AIX file system to linux 7.2 as it is. could you please highlight what are the things we need to look into it . in AIX we are using .netrc to... (3 Replies)
Discussion started by: Riverstone
3 Replies
All times are GMT -4. The time now is 09:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy