This content has been marked as final. Show 3 replies
BMP wrote:I assume you mean 'Bourne shell' ... though possibly you have Posix (which is meant to be close to ksh).
We recently migrated the databases from a HP-Unix server 11i to OEL 5.0 Server. As a part of the move we also had to migrate the shell scripts from Unix.
The source scripts uses B-Shell and when we try to run this on OEL nothing works. It looks like we may have to rewrite for BASH or KORN Shell in OEL 5.0.
I have very limited experience in writing shell scripts and need expert guidence on how the existing script could be modified to work in Linux. Any useful pointer would be great help.
In general ... with exceptions ... ksh and bash are a superset of (bourne shell).
Two things can help:
 Check the first line in the scripts and indicate what it is .....
head -1 some-shell-script.
Does hte she-bang command exit on OEL?
 Post one or show of the error messages here.
... It is possilbe you are getting one basic error/problem repeated everywhere rather than a lot of different eror messages
If you give examples ... without compromising your security .. that may be a more focused answer
What is "B-shell"?
The default shell under HP-UX 11i is Posix shell, which is close to the Korn shell (ksh).
Bash is the default shell on all Linux systems and is generally compatible with ksh'93 (ksh) and Bourne shell (sh). You can use "set -o posix" while Bash is running to tell Bash to conform more closely to the Posix standard.
For more details about Bash in Posix mode:
Some commercial system use ksh'88, which is not available in Linux. In this case your best option is "pdksh", which is a public domain version that provides most of the features of ksh'88. It's no longer available available since Oracle Linux 6 though.
The following might help you to determine what needs to be changed:
I suggest to find out what shell you are actually using. You can normally check the first line in a script and check what is specified after #!. If you do not have a hash-bang in the script it will be using the login shell.