I have taken care of these types of site specific problems
by using
autoconf.
I believe perl configure might be a good (or better) solution
But I am not that familiar with it.
Here's a quick start on autoconf. Autoconf has a lot of documentation.
LameNerd@maxtrix6 ~/scripts_IN/conf_test
$ ls -l
total 2
-rwxrwxrwx 1 LameNerd None 320 Jul 8 11:47 configure.
+ac
-rwxrwxrwx 1 LameNerd None 231 Jul 8 11:48 test.in
LameNerd@maxtrix6 ~/scripts_IN/conf_test
$ cat configure.ac
AC_INIT( test, 1.0 )
dnl
AC_DEFUN([AC_ORACLE_HOME],[dnl
AC_MSG_CHECKING(Checking for oracle home)
if test -z "$ORACLE_HOME"; then
AC_ERROR(No oracle home env var)
else
AC_MSG_RESULT(ok)
AC_SUBST( ORACLE_HOME, "$ORACLE_HOME" )
fi
])dnl
dnl
AC_ORACLE_HOME( ORACLE_HOME )
AC_OUTPUT( [ test] )
LameNerd@maxtrix6 ~/scripts_IN/conf_test
$ cat test.in
#!/bin/sh
####################################################
### This script is intended as a example of how to
### use autoconf to determine ORACLE_HOME.
####################################################
@ORACLE_HOME@
LameNerd@maxtrix6 ~/scripts_IN/conf_test
$ autoconf
LameNerd@maxtrix6 ~/scripts_IN/conf_test
$ ls -l
total 65
drwxr-xr-x+ 2 LameNerd None 0 Jul 8 11:48 autom4te.c
+ache
-rwxrwxrwx 1 LameNerd None 64409 Jul 8 11:48 configure
-rwxrwxrwx 1 LameNerd None 320 Jul 8 11:47 configure.
+ac
-rwxrwxrwx 1 LameNerd None 231 Jul 8 11:48 test.in
LameNerd@maxtrix6 ~/scripts_IN/conf_test
$ ./configure
checking Checking for oracle home... ok
configure: creating ./config.status
config.status: creating test
LameNerd@maxtrix6 ~/scripts_IN/conf_test
$ ls -l
total 90
drwxr-xr-x+ 2 LameNerd None 0 Jul 8 11:48 autom4te.c
+ache
-rw-rw-rw- 1 LameNerd None 3630 Jul 8 11:49 config.log
-rwxrwxrwx 1 LameNerd None 19840 Jul 8 11:48 config.sta
+tus
-rwxrwxrwx 1 LameNerd None 64409 Jul 8 11:48 configure
-rwxrwxrwx 1 LameNerd None 320 Jul 8 11:47 configure.
+ac
-rw-rw-rw- 1 LameNerd None 227 Jul 8 11:49 test
-rwxrwxrwx 1 LameNerd None 231 Jul 8 11:48 test.in
LameNerd@maxtrix6 ~/scripts_IN/conf_test
$ cat test
#!/bin/sh
####################################################
### This script is intended as a example of how to
### use autoconf to determine ORACLE_HOME.
####################################################
d:\Oracle\Ora81
LameNerd@maxtrix6 ~/scripts_IN/conf_test
$