From: kielhd on
Hi NG,

I am writing a script that runs on various UNIX derivatives. For every
derivative, specific commands are executed.

For Linux, AIX and HP-UX the script is running ok.
The next derivative to be implemented is SunOS. SunOS comes up with
the following problem:

In order handle all the derivatives in ONE script, there is a separate
function for each derivative within the script. This function is
accessed, if the script is executed on this derivative.


....
function Linux
(
....
)

function AIX
(
....
)

function HPUX
(
....
)
....
etc.

The problem in SunOS is, that the command 'function' is not
implemented into the Bourne shell.

Question:
How can the script for SunOS be modified, so that it is still running
on the other derivatives?

TIA,
Henning
From: Casper H.S. Dik on
kielhd <kielhd(a)freenet.de> writes:

>The problem in SunOS is, that the command 'function' is not
>implemented into the Bourne shell.

Either use /usr/xpg4/bin/sh or use:

foo ()

rather than
function foo


Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.