Salome HOME
PR: merge from branch BR_auto_V310 tag mergefrom_OCC_development_for_3_2_0a2_10mar06
[modules/kernel.git] / bin / appliskel / runRemote.sh
index d3297a6c5ce80e561dab308ffbef69694e56203c..293ecff6d425e89d2d3cf26b16c43c9f5ce6b13c 100755 (executable)
 #     $3 and following : local command to execute, with args
 #
 
-# --- retrieve APPLI path, relative to $HOME
-#     on sarge, "which" gives not allways the absolute path...
-     
-comName=`which $0`
-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
+# --- retrieve APPLI path, relative to $HOME, set ${APPLI}
+
+. `dirname $0`/setAppliPath.sh
 
 # --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...)
 
@@ -43,9 +31,12 @@ export APPLI
 
 # --- set the OMNIORB_CONFIG file and environment relative to this run of SALOME
 
-export OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_$1_$2.cfg
-export NSHOST=$1
-export NSPORT=$2
+OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_$1_$2.cfg
+export OMNIORB_CONFIG
+NSHOST=$1
+export NSHOST
+NSPORT=$2
+export NSPORT
 initref="NameService=corbaname::"$1":$2"
 echo "ORBInitRef $initref" > $OMNIORB_CONFIG
 
@@ -53,4 +44,4 @@ echo "ORBInitRef $initref" > $OMNIORB_CONFIG
 
 shift 2
 
-${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/bash --rcfile $HOME/$APPLI/.bashrc -c "$*"
+${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/sh --rcfile $HOME/$APPLI/.bashrc -c "$*"