Results 1 to 4 of 4
Hi,
We are currently running our applications on AIX 5. We are moving to suseLinux.
A lot of work in the automated build/deployment process is done through shell scripts. We ...
- 08-19-2009 #1Just Joined!
- Join Date
- Aug 2009
- Posts
- 2
porting shell scripts from AIX to Linux
Hi,
We are currently running our applications on AIX 5. We are moving to suseLinux.
A lot of work in the automated build/deployment process is done through shell scripts. We want to know if there are any issues porting/running our shell scripts on Linux. Will these same scripts work on the suseLinux or we need to rewrite them altogether?
Thanks!
Santosh
PS: I posted the same question on suse Linux Help.
- 08-20-2009 #2
It is, of course, against the forum rules to post the same question to multiple forums. But thanks for letting us know.
If your version of AIX is running things through a standard shell, you may find that things almost work as you'd expect. Major differences may come with filesystem structure or with commands called from the scripts which may have different parameters, or even be replaced by different commands entirely.
You may find it eaiser to set up a VM with SuSE on it just to try the scripts out. If you can find out what needs fixing very early in this project you'll have a better chance of straightening it out before your shiny new system goes live.Linux user #126863 - see http://linuxcounter.net/
- 08-20-2009 #3Linux Newbie
- Join Date
- Mar 2009
- Posts
- 228
msk,
We have ported scripts to Linux but in our case is has been ksh scripts ported from Tru64 UNIX to Red Hat Linux. What Roxoff has mentioned is what we experienced. Such as:
Verbose option for the rm command: in Linux it’s –v, in Tru64 it’s –e
To send mail the command: in Linux it’s mail, in Tru64 it’s mailx
Since we still use the same scripts on both Tru64 & Linux we added code in the beginning to check what the OS is and set variables for options and commands. For example:
The biggest problem to solve that we encountered was how variables are handled within while/read loops that have lines piped to them. For example:Code:if [ `uname` = “Linux” ] then rmver=”-v” mailcmd=”mail” else rmver=”-e” mailcmd=”mailx” fi
The CT variable value is lost outside the loop. We had to change the scripts to not use pipes for the loops:Code:cat $FLE | while read $LNE do CT=CT+1 done
Since bash is the default shell in Linux I have ported a few ksh scripts to bash without too much trouble.Code:while read $LNE do CT=CT+1 done < $_FILE
- 08-20-2009 #4Just Joined!
- Join Date
- Aug 2009
- Posts
- 2
Thank you for all your inputs. As you suggested we are planning in a phased process, meaning testing one piece at a time. Also most of our scripts are in bash, we are expecting less trouble while porting.
Thanks again.
I will make sure not to post in multiple forums in future.


Reply With Quote