AIX to Linux


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting AIX to Linux
# 1  
Old 11-23-2010
Error AIX to Linux

I am Application Administrator with little bit experience with UNIX , We are changing the OS from AIX to Red hat Linux . Wondering if there anyway how to change the scripts to work on LINUX env and how to start to modify the scripts..Any Suggestions

Thanks in Advance
# 2  
Old 11-23-2010
A good general overview concerning commands and important files can be found here: Rosetta Stone for Unix

Concerning shell scripts, make sure that you specify the exact shell needed (eg. /usr/bin/ksh) instead of a general shell, and rewrite hard-coded paths to use either $PATH or script-specific variables that can easily be adapted.
# 3  
Old 11-23-2010
If the paths of script interpreters have changed, you might just add symlinks for them. If a script interpreter is missing, see if you can install a compatible version.

Another thing to scan for is dynamic library path setting:

Shared Libraries
3.3.1. LD_LIBRARY_PATH

You can temporarily substitute a different library for this particular execution. In Linux, the environment variable LD_LIBRARY_PATH is a colon-separated set of directories where libraries should be searched for first, before the standard set of directories; this is useful when debugging a new library or using a nonstandard library for special purposes. The environment variable LD_PRELOAD lists shared libraries with functions that override the standard set, just as /etc/ld.so.preload does. These are implemented by the loader /lib/ld-linux.so. I should note that, while LD_LIBRARY_PATH works on many Unix-like systems, it doesn't work on all; for example, this functionality is available on HP-UX but as the environment variable SHLIB_PATH, and on AIX this functionality is through the variable LIBPATH (with the same syntax, a colon-separated list).
# 4  
Old 11-29-2010
Thanks Pickeet and Pludi for the replies..I started tweaking the scripts and I am stuck with this , We have Main Script which inturns invokes the Child script and main script is failing to locate the child script specified in main script. This is the content of Main Script where its locating the child script and failing in Linux

AIX
#!/bin/ksh
. /apps/webroot/admin/websrc

LINUX
#!/bin/bash
. /apps/webroot/admin/websrc

'apps/webroot/admin/websrc: line 2: syntax error near unexpected token `in

Checked for any empty spaces or invalid characters which might have caused syntax error and found nothing

Also One more error

/apps/webroot/admin/websrc: line 71: typeset: -u: invalid option

In AIX its defined as

typeset -u ENV_DESC=${WEBSRC_ENV}

Please Suggest where am i doing wrong...
# 5  
Old 11-29-2010
The error message pertains to line 2 of the sourced file /apps/webroot/admin/websrc not line 2 of the calling script.

instead of the ksh
Code:
typeset -u ENV_DESC=${WEBSRC_ENV}

you could try this bash expansion:
Code:
ENV_DESC=${WEBSRC_ENV}
echo "${ENV_DESC^^}"

# 6  
Old 11-29-2010
Isn't typeset -u for conversion to upper case?

I would have thought this would have been closer:

Code:
ENV_DESC=$(echo ${WESRC_ENV} | tr [a-z] [A-Z])

Rather than convert all your scripts from ksh to bash, have you considered trying pdksh?
# 7  
Old 11-29-2010
so you why not use ksh in Linux also and replace by bash?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. AIX

Linux software on AIX 5.3

Hi Team, On a client requirement, we need to install below Linux software on IBM AIX 5.3 operating system, Apache Maven 3.2.3 MySQL 5.1.73, Sonarqube 4.1.2, Apache Tomcat 7.0.42, Jenkins 1.549 Please tell us whether above tool versions are compatible to AIX 5.3 (4 Replies)
Discussion started by: dnr.simha23
4 Replies

3. AIX

backup linux like aix

Hello everyone I need to backup some boxes with redhat enterprise for power. I was looking for software but I need to umount filesystems,etc,etc. I need a software that backup like I do with my aix boxes. mksysb command and thatīs it. Because I need to do online, with no umount fs. ... (5 Replies)
Discussion started by: lo-lp-kl
5 Replies

4. UNIX for Dummies Questions & Answers

fuser on aix vs. linux

Pls. advise why on AIX the exit status is always '0' and on Linux it is always '1' even if the I just created a new file. I'm thinking if there is a background process monitoring the created 'file1' on AIX even if it is just a dummy or new file. How can I resolve this. (I need to justify that... (1 Reply)
Discussion started by: budz26
1 Replies

5. AIX

AIX IBM I and LINUX

As I know PowerVM supports these OS's AIX IBM I and LINUX but is there any blade or other hardware that allows us to use all these OS's (1 Reply)
Discussion started by: Vit0_Corleone
1 Replies

6. 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

7. AIX

Aix 5.3 or Linux?

Hey I have an IBM IntelliStation Power 9114 Model 275 1.45GHz Workstation 1-Way 1.45GHz Power4+ Processor (5223) 2GB Memory (4x 512MB Dimms) (4447) and was told that AIX 5.3 works on it, and that there was problems with Linux installs. Can I download AIX 5.3 or do I need to buy... (13 Replies)
Discussion started by: newtoaix
13 Replies

8. Fedora

Installation Of Linux on an AIX server

Hi, Is it possible to install Linux on an AIX server? Is there any doc available with anyone for installation? Please help. (1 Reply)
Discussion started by: dwiravi
1 Replies

9. Shell Programming and Scripting

Different output in AIX and Linux OS

Hi All , Please help me in understanding why i am getting error for the below script in LINUX, but the same script will work perfectly in AIX unix. Script Name:try.ksh #!/bin/ksh echo "$0 \n" MYPWD=$(pwd $(dirname $0)) echo " $MYPWD \n" O/P in LINUX OS: ./try.ksh ./try.ksh:... (2 Replies)
Discussion started by: sudhir_barker
2 Replies

10. UNIX for Advanced & Expert Users

Find in HP,AIX vs Linux

Hi Guys, Wondering if anyone can help me. I have a find command on a Linux box that works as expected: find \( -not -type d -or -not -name log -and -not -name loc -and -not -name usr -and -not -name etc -and -not -name tmp -and -not -name wrk -and -not -name changes -or -prune \) -and -not... (6 Replies)
Discussion started by: bParks
6 Replies
Login or Register to Ask a Question