#!/bin/bash #============================================================================= # Launcher for Oracle OWB 11g # Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. #============================================================================= #----------------------------------------------------------------------------- # toAbsPath() takes two arguments # 1) a pathname (assumed to point to a file) # 2) a directory that the pathname is relative to # # and converts the pathname to an absolute path (if necessary), resolving # any "." or ".." in the absolute path. The result is echoed to STDOUT. #----------------------------------------------------------------------------- toAbsPath() { local pathname="$1" local rawAbsPath # Test if $arg starts with '/'. if [ "X`expr \"${pathname}\" : '\(/\).*'`" = "X/" ] then rawAbsPath="${pathname}" else local relativeTo="$2" rawAbsPath="${relativeTo}/${pathname}" fi # Resolve any "." and ".." in $rawAbsPath. local cwd=`pwd` local rawAbsDir=`dirname "$rawAbsPath"` local basename=`basename "$rawAbsPath"` cd "${rawAbsDir}" local dir=`pwd -P` cd "${cwd}" echo "${dir}/${basename}" } #----------------------------------------------------------------------------- # getSymlinkTarget() takes one argument # 1) a pathname # # If the pathname is a symlink, the symlink target is echoed to STDOUT. # If the pathname is not a symlink, the pathname itself is echoed. #----------------------------------------------------------------------------- getSymlinkTarget() { local pathname="$1" while [ -h "$pathname" ] ; do local ls=`ls -ld "$pathname"` local link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '.*/.*' > /dev/null then pathname="$link" else pathname="`dirname \"$pathname\"`/$link" fi done echo "$pathname" } #----------------------------------------------------------------------------- # main #----------------------------------------------------------------------------- STARTING_CWD=`pwd` readonly STARTING_CWD # INVOKED_AS contains the absolute path of the script invocation. INVOKED_AS=`toAbsPath "$0" "\`pwd\`"` readonly INVOKED_AS # SCRIPT contains the absolute path of the actual (symlink-resolved) script. SCRIPT=`toAbsPath "\`getSymlinkTarget \"${INVOKED_AS}\"\`" "\`dirname \"${INVOKED_AS}\"\`"` readonly SCRIPT . "`dirname "${SCRIPT}"`/../../ide/bin/launcher.sh" # A segmentation fault or other core dump at startup can occur if # the shell's stack size limit is too small. Uncomment the following # line to raise the stack size to 4MB or more. #ulimit -s 4096 #----------------------------------------------------------------------------- # product-specific function overrides #----------------------------------------------------------------------------- GetFullProductName() { echo "Oracle OWB 11gR2 (Tahoe)" } GetShortProductName() { echo "OWB" } # check if JAVA64FLAG is needed PLATF=`/bin/uname -s` case $PLATF in HP-UX) JAVA64FLAG="-d64" AddVMOption ${JAVA64FLAG} ;; SunOS) JAVA64FLAG="-d64" AddVMOption ${JAVA64FLAG} ;; esac # set Java property oracle.home to OWB source root if [ "x${OWB_HOME}" == "x" ]; then SCRIPT_DIR=`dirname "${SCRIPT}"` OWB_HOME=`dirname \`toAbsPath ${SCRIPT_DIR}/../../x\`` fi AddVMOption -Doracle.home=${OWB_HOME} # set ORACLE_HOME environment variable to Oracle installation (bug 5886255) export OWBCC_HOME=%ORACLE_HOME% ORACLE_HOME=${OWBCC_HOME} LaunchIDE "$@"