This discussion is archived
3 Replies Latest reply: Oct 16, 2012 10:52 AM by Johan Louwers RSS

Migrating Shell scripts from HP-Unix 11i to OEL 5.0

user400481 Newbie
Currently Being Moderated
Hi :

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.

Regards,

Bala
  • 1. Re: Migrating Shell scripts from HP-Unix 11i to OEL 5.0
    bigdelboy Pro
    Currently Being Moderated
    BMP wrote:
    Hi :

    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.

    Regards,

    Bala
    I assume you mean 'Bourne shell' ... though possibly you have Posix (which is meant to be close to ksh).

    .....

    In general ... with exceptions ... ksh and bash are a superset of (bourne shell).

    ......


    Two things can help:

    [1] 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?

    [2] 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
  • 2. Re: Migrating Shell scripts from HP-Unix 11i to OEL 5.0
    Dude! Guru
    Currently Being Moderated
    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:
    http://www.gnu.org/software/bash/manual/html_node/Bash-POSIX-Mode.html

    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:
    http://www.faqs.org/faqs/unix-faq/shell/shell-differences/

    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.
  • 3. Re: Migrating Shell scripts from HP-Unix 11i to OEL 5.0
    Johan Louwers Explorer
    Currently Being Moderated
    Guess it would make sense indeed to give us some insight in what you exactly mean by b-shell so we can give you some more detailed guidance.

    Regards,
    Johan Louwers

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points