From f06611bf4d02c8068890ede5ab6e64eda295a642 Mon Sep 17 00:00:00 2001 From: prascle Date: Fri, 10 Jun 2005 05:49:03 +0000 Subject: [PATCH] PR: on Debian Sarge, 'which' gives not allways the absolute path --- bin/appliskel/runAppli | 12 +++++++++++- bin/appliskel/runConsole | 12 +++++++++++- bin/appliskel/runRemote.sh | 12 +++++++++++- bin/appliskel/runSession | 12 +++++++++++- 4 files changed, 44 insertions(+), 4 deletions(-) diff --git a/bin/appliskel/runAppli b/bin/appliskel/runAppli index adf08f527..3e703bc64 100755 --- a/bin/appliskel/runAppli +++ b/bin/appliskel/runAppli @@ -1,9 +1,19 @@ #!/bin/bash # --- retrieve APPLI path, relative to $HOME +# on sarge, "which" gives not allways the absolute path... comName=`which $0` -APPLI=`echo ${HOME} \`dirname $comName\` | awk ' { print substr($2,length($1)+2) } '` +aa=${comName:0:1} +if test x$aa == x\/; then + mycom=${comName} +elif test x$aa == x\.; then + mycom=${PWD}/${comName:2} +else + mycom=${PWD}/${comName} +fi +APPLI=`echo ${HOME} \`dirname $mycom\` | awk ' { print substr($2,length($1)+2) } '` +#echo $APPLI export APPLI # --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...) diff --git a/bin/appliskel/runConsole b/bin/appliskel/runConsole index 5218ea4ed..e45f58611 100755 --- a/bin/appliskel/runConsole +++ b/bin/appliskel/runConsole @@ -1,9 +1,19 @@ #!/bin/bash # --- retrieve APPLI path, relative to $HOME +# on sarge, "which" gives not allways the absolute path... comName=`which $0` -APPLI=`echo ${HOME} \`dirname $comName\` | awk ' { print substr($2,length($1)+2) } '` +aa=${comName:0:1} +if test x$aa == x\/; then + mycom=${comName} +elif test x$aa == x\.; then + mycom=${PWD}/${comName:2} +else + mycom=${PWD}/${comName} +fi +APPLI=`echo ${HOME} \`dirname $mycom\` | awk ' { print substr($2,length($1)+2) } '` +#echo $APPLI export APPLI # --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...) diff --git a/bin/appliskel/runRemote.sh b/bin/appliskel/runRemote.sh index 72f3d069e..84a125765 100755 --- a/bin/appliskel/runRemote.sh +++ b/bin/appliskel/runRemote.sh @@ -22,9 +22,19 @@ # # --- retrieve APPLI path, relative to $HOME +# on sarge, "which" gives not allways the absolute path... comName=`which $0` -APPLI=`echo ${HOME} \`dirname $comName\` | awk ' { print substr($2,length($1)+2) } '` +aa=${comName:0:1} +if test x$aa == x\/; then + mycom=${comName} +elif test x$aa == x\.; then + mycom=${PWD}/${comName:2} +else + mycom=${PWD}/${comName} +fi +APPLI=`echo ${HOME} \`dirname $mycom\` | awk ' { print substr($2,length($1)+2) } '` +#echo $APPLI export APPLI # --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...) diff --git a/bin/appliskel/runSession b/bin/appliskel/runSession index ddbbbbe9c..d94bfff6c 100755 --- a/bin/appliskel/runSession +++ b/bin/appliskel/runSession @@ -6,9 +6,19 @@ # # --- retrieve APPLI path, relative to $HOME +# on sarge, "which" gives not allways the absolute path... comName=`which $0` -APPLI=`echo ${HOME} \`dirname $comName\` | awk ' { print substr($2,length($1)+2) } '` +aa=${comName:0:1} +if test x$aa == x\/; then + mycom=${comName} +elif test x$aa == x\.; then + mycom=${PWD}/${comName:2} +else + mycom=${PWD}/${comName} +fi +APPLI=`echo ${HOME} \`dirname $mycom\` | awk ' { print substr($2,length($1)+2) } '` +#echo $APPLI export APPLI # --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...) -- 2.39.2