#!/bin/bash # # Useful shell to run executable progs or shells under Salome env # Use it with args to run a program : runSession python -i myprog.py # Use it without args to run an interactive shell under Salome env # # --- 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 # --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...) . ${HOME}/${APPLI}/envd ${HOME}/${APPLI} myhost=`hostname` export OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg # --- invoque shell with or without args if [ $# -ne 0 ] ; then ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/bash --rcfile ${HOME}/${APPLI}/.bashrc -c "$*" else ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/bash --rcfile ${HOME}/${APPLI}/.bashrc fi