Operating System - HP-UX
1753971 Members
7493 Online
108811 Solutions
New Discussion юеВ

Re: default hpux posix shell doenst work but ksh does on orace weblogic script

 
p7
Frequent Advisor

default hpux posix shell doenst work but ksh does on orace weblogic script

hi all,

 

a customer is trying to setup oracle weblogic on hpux 11.31. hes trying to run a reports.sh script with the default /bin/sh but it keeps having problems assigning variables. when he runs it as a ksh it works.

oracle support also ran it on a similiar hpux box they have and it worked. the customer doesnt really want to run ksh, he d

rather run the default hpux shell.

 

has anyone ever run into something similiar?

 

thx in advance

 

4 REPLIES 4
Bill Hassell
Honored Contributor

Re: default hpux posix shell doenst work but ksh does on orace weblogic script

The script is missing the interpreter line: #!/usr/bin/ksh

The shell you use to login will be the default for scripts that do not specify the intended interpreter. That's why I consider the interpreter mandatory for all shell scripts. For about 95% of the features in the POSIX shell, ksh is a match, but there are differences, just like there are differences between bash and ksh. All 3 are considered to be 'POSIX' compliant but shell script writers are not often aware of the differences, thus the problems.

 

So keep your standard /usr/bin/sh or /sbin/sh POSIX shell and just add the interpreter line to the WebLogic script.



Bill Hassell, sysadmin
p7
Frequent Advisor

Re: default hpux posix shell doenst work but ksh does on orace weblogic script

thx for the quick reply,

 

here is the top of the script, isnt that ok?

 

 

#!/bin/sh
#
# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
#

## Example file to set environment variables in Bourne-shell or K-shell
## for Oracle Reports 10gR2. Refer to Install Doc for more detail on each
## of these environment variables. You need to modify some of the environment
## variables before doing source on this file ( % . reports.sh ).

Bill Hassell
Honored Contributor

Re: default hpux posix shell doenst work but ksh does on orace weblogic script

Yes, #!/bin/sh is the interpreter line and it specifies the POSIX shell (/bin/sh points to /usr/bin/sh).

So change it to #!/usr/bin/ksh and the script should work fine.



Bill Hassell, sysadmin
p7
Frequent Advisor

Re: default hpux posix shell doenst work but ksh does on orace weblogic script

thx