src/os/posix/launcher/launcher.script
Print this page
rev 2750 : 7099454: /bin/sh does not support syntax used in the src/os/posix/launcher/launcher.script shell script
Summary: Also reviewed by mikael.gerdin@oracle.com; Changed to the `` syntax instead. Also changed "source" to ".".
Reviewed-by: stefank
@@ -1,8 +1,8 @@
#!/bin/sh
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
@@ -67,12 +67,12 @@
#
# End of user changeable parameters -----------------------------------------
#
# Make sure the paths are fully specified, i.e. they must begin with /.
-SCRIPT=$(cd $(dirname $0) && pwd)/$(basename $0)
-RUNDIR=$(pwd)
+REL_MYDIR=`dirname $0`
+MYDIR=`cd $REL_MYDIR && pwd`
# Look whether the user wants to run inside gdb
case "$1" in
-gdb)
MODE=gdb
@@ -93,16 +93,13 @@
*)
MODE=run
;;
esac
-# Find out the absolute path to this script
-MYDIR=$(cd $(dirname $SCRIPT) && pwd)
-
JDK=
if [ "${ALT_JAVA_HOME}" = "" ]; then
- source ${MYDIR}/jdkpath.sh
+ . ${MYDIR}/jdkpath.sh
else
JDK=${ALT_JAVA_HOME%%/jre};
fi
if [ "${JDK}" = "" ]; then
@@ -117,13 +114,10 @@
# any.
JRE=$JDK/jre
JAVA_HOME=$JDK
ARCH=@@LIBARCH@@
-# Find out the absolute path to this script
-MYDIR=$(cd $(dirname $SCRIPT) && pwd)
-
SBP=${MYDIR}:${JRE}/lib/${ARCH}
# Set up a suitable LD_LIBRARY_PATH
if [ -z "$LD_LIBRARY_PATH" ]
@@ -144,11 +138,11 @@
echo Error: Cannot find the gamma development launcher \"$LAUNCHER\"
exit 1
fi
GDBSRCDIR=$MYDIR
-BASEDIR=$(cd $MYDIR/../../.. && pwd)
+BASEDIR=`cd $MYDIR/../../.. && pwd`
init_gdb() {
# Create a gdb script in case we should run inside gdb
GDBSCR=/tmp/hsl.$$
rm -f $GDBSCR
@@ -177,11 +171,11 @@
;;
gud)
init_gdb
# First find out what emacs version we're using, so that we can
# use the new pretty GDB mode if emacs -version >= 22.1
- case $($EMACS -version 2> /dev/null) in
+ case `$EMACS -version 2> /dev/null` in
*GNU\ Emacs\ 2[23]*)
emacs_gud_cmd="gdba"
emacs_gud_args="--annotate=3"
;;
*)