muizelaar has asked for the wisdom of the Perl Monks concerning the following question:

I’m attempting to write a request script for a Solaris package, does any one know if it’s possible to use Perl rather than using the Bourne shell. If so has anyone got any templates I could have a look at. :)

Replies are listed 'Best First'.
Re: Solaris Package request script
by Old_Gray_Bear (Bishop) on Oct 02, 2007 at 17:25 UTC
    While it is *possible* to write installation scripts in something other than Bourne-shell, there is a strong reason to do so. You are **guaranteed** to have the Bourne shell available during a Solaris installation. You have no such guarantee for any other language.

    By putting the requirement of Perl on your 'request script', you run the risk of blowing your Package Installation when a User tries to install your package a) on a machine that does not have Perl installed, b) does not want to have Perl installed on the machine, or c) has an excessively old version of Perl installed. (I have not seen any Solaris distributions with a Perl older than 5.000, so at least you don't have to maintain backward compatibility with Perl4.)

    That said, your templates for any install-scripting problem are found in the RC files. It's relatively SMoP (Simple Matter of Programming) to write Perl code from a Bourne Shell psuedo-code template. (But only as a learning exercise, not for something that's going into Production or (even worse) into the Public Domain.)

    Happy Coding!

    ----
    I Go Back to Sleep, Now.

    OGB