From: prascle Date: Fri, 10 Jun 2005 05:49:03 +0000 (+0000) Subject: PR: on Debian Sarge, 'which' gives not allways the absolute path X-Git-Tag: BR_V220_LifeCycle_testAppli X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f06611bf4d02c8068890ede5ab6e64eda295a642;p=modules%2Fkernel.git PR: on Debian Sarge, 'which' gives not allways the absolute path --- 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...)