From 16a23e138e71f7d8bfb835fa9370db52f091690d Mon Sep 17 00:00:00 2001 From: uce Date: Fri, 13 Sep 2013 16:05:17 +0200 Subject: [PATCH] Fixed nephele-config.sh substr command calls on OS X (closes #88) --- .../src/main/stratosphere-bin/bin/nephele-config.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/stratosphere-dist/src/main/stratosphere-bin/bin/nephele-config.sh b/stratosphere-dist/src/main/stratosphere-bin/bin/nephele-config.sh index 5194954c074..c64fc0e39e6 100755 --- a/stratosphere-dist/src/main/stratosphere-bin/bin/nephele-config.sh +++ b/stratosphere-dist/src/main/stratosphere-bin/bin/nephele-config.sh @@ -19,7 +19,8 @@ # but the windows java version expects them in Windows Format, i.e. C:\bla\blub. # "cygpath" can do the conversion. manglePath() { - if [ "$(expr substr $(uname -s) 1 6)" == "CYGWIN" ]; then + UNAME=$(uname -s) + if [ "${UNAME:0:6}" == "CYGWIN" ]; then echo `cygpath -w $1` else echo $1 @@ -27,8 +28,9 @@ manglePath() { } manglePathList() { + UNAME=$(uname -s) # a path list, for example a java classpath - if [ "$(expr substr $(uname -s) 1 6)" == "CYGWIN" ]; then + if [ "${UNAME:0:6}" == "CYGWIN" ]; then echo `cygpath -wp $1` else echo $1 @@ -73,7 +75,8 @@ if [ -z "${JAVA_HOME+x}" ]; then JAVA_HOME=/usr/lib/jvm/java-6-sun/ fi -if [ "$(expr substr $(uname -s) 1 6)" == "CYGWIN" ]; then +UNAME=$(uname -s) +if [ "${UNAME:0:6}" == "CYGWIN" ]; then JAVA_RUN=java else if [[ -d $JAVA_HOME ]]; then -- GitLab