From: rahuel Date: Thu, 9 Feb 2006 15:04:16 +0000 (+0000) Subject: sh <--> bash X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=08ca2bd8d66eb09fa5deaf82495b2df7c404e213;p=modules%2Fkernel.git sh <--> bash export syntax --- diff --git a/bin/appliskel/killCurrentPort b/bin/appliskel/killCurrentPort index bca506068..cfb87da78 100755 --- a/bin/appliskel/killCurrentPort +++ b/bin/appliskel/killCurrentPort @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # --- retrieve APPLI path, relative to $HOME, set ${APPLI} @@ -14,7 +14,8 @@ myhost=`hostname` fileOmniConfig=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg if [ -f $fileOmniConfig ]; then - export OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg + OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg + export OMNIORB_CONFIG fi currentPort=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py port` diff --git a/bin/appliskel/runAppli b/bin/appliskel/runAppli index 1d86ad3d5..7146b6b82 100755 --- a/bin/appliskel/runAppli +++ b/bin/appliskel/runAppli @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # --- retrieve APPLI path, relative to $HOME, set ${APPLI} diff --git a/bin/appliskel/runConsole b/bin/appliskel/runConsole index caeabbdd6..1756189ff 100755 --- a/bin/appliskel/runConsole +++ b/bin/appliskel/runConsole @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # --- retrieve APPLI path, relative to $HOME, set ${APPLI} diff --git a/bin/appliskel/runParam b/bin/appliskel/runParam index c858c670f..68e5a25c0 100755 --- a/bin/appliskel/runParam +++ b/bin/appliskel/runParam @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh ./KillCurrentPort diff --git a/bin/appliskel/runRemote.sh b/bin/appliskel/runRemote.sh index 594616a07..3ab5a1daf 100755 --- a/bin/appliskel/runRemote.sh +++ b/bin/appliskel/runRemote.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # --- run command in SALOME environment from remote call, ssh or rsh # - SALOME configuration is defined by : @@ -31,9 +31,12 @@ # --- 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 @@ -41,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 "$*" diff --git a/bin/appliskel/runSession b/bin/appliskel/runSession index 22d3fdd0f..1f99cce7b 100755 --- a/bin/appliskel/runSession +++ b/bin/appliskel/runSession @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Useful shell to run executable progs or shells under Salome env # Use it with args to run a program : runSession python -i myprog.py @@ -19,19 +19,22 @@ myhost=`hostname` fileOmniConfig=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg if [ -f $fileOmniConfig ]; then - export OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg + OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg + export OMNIORB_CONFIG # --- set environment variables for port and hostname of NamingService - export NSHOST=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py host` - export NSPORT=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py port` + NSHOST=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py host` + export NSHOST + NSPORT=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py port` + export NSPORT fi # --- invoque shell with or without args if [ $# -ne 0 ] ; then - ${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 "$*" else - ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/bash --rcfile ${HOME}/${APPLI}/.bashrc + ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/sh --rcfile ${HOME}/${APPLI}/.bashrc fi diff --git a/bin/appliskel/runTests b/bin/appliskel/runTests index 755825d79..4ff2bc186 100755 --- a/bin/appliskel/runTests +++ b/bin/appliskel/runTests @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # --- retrieve APPLI path, relative to $HOME, set ${APPLI} @@ -21,13 +21,16 @@ searchFreePort() { if [ -z "$aRes" ]; then echo ${NSPORT} - Ok local myhost=`hostname` - export OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_${myhost}_${NSPORT}.cfg + OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_${myhost}_${NSPORT}.cfg + export OMNIORB_CONFIG export NSPORT - export NSHOST=${myhost} + NSHOST=${myhost} + export NSHOST local initref="NameService=corbaname::"`hostname`":$NSPORT" #echo "ORBInitRef $initref" > $OMNIORB_CONFIG echo "InitRef = $initref" > $OMNIORB_CONFIG - export LAST_RUNNING_CONFIG=${HOME}/${APPLI}/.omniORB_${myhost}_test.cfg + LAST_RUNNING_CONFIG=${HOME}/${APPLI}/.omniORB_${myhost}_test.cfg + export LAST_RUNNING_CONFIG rm ${LAST_RUNNING_CONFIG} ln -s ${OMNIORB_CONFIG} ${LAST_RUNNING_CONFIG} break @@ -55,10 +58,10 @@ fi searchFreePort if [ $# -ne 0 ] ; then - ${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 "$*" else - ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/bash --rcfile ${HOME}/${APPLI}/.bashrc + ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/sh --rcfile ${HOME}/${APPLI}/.bashrc fi rm ${OMNIORB_CONFIG} diff --git a/bin/appliskel/searchFreePort.sh b/bin/appliskel/searchFreePort.sh index 8108a93dc..7333b1ce7 100755 --- a/bin/appliskel/searchFreePort.sh +++ b/bin/appliskel/searchFreePort.sh @@ -1,10 +1,11 @@ -#!/bin/bash +#!/bin/sh # --- define port for CORBA naming service searchFreePort() { echo -n "Searching for a free port for naming service: " - export NSPORT=2810 + NSPORT=2810 + export NSPORT local limit=$NSPORT let limit=limit+100 while [ 1 ] @@ -13,13 +14,16 @@ searchFreePort() { if [ -z "$aRes" ]; then echo ${NSPORT} - Ok local myhost=`hostname` - export OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_${myhost}_${NSPORT}.cfg + OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_${myhost}_${NSPORT}.cfg + export OMNIORB_CONFIG export NSPORT - export NSHOST=${myhost} + NSHOST=${myhost} + export NSHOST local initref="NameService=corbaname::"`hostname`":$NSPORT" #echo "ORBInitRef $initref" > $OMNIORB_CONFIG echo "InitRef = $initref" > $OMNIORB_CONFIG - export LAST_RUNNING_CONFIG=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg + LAST_RUNNING_CONFIG=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg + export LAST_RUNNING_CONFIG rm ${LAST_RUNNING_CONFIG} ln -s ${OMNIORB_CONFIG} ${LAST_RUNNING_CONFIG} break diff --git a/bin/appliskel/setAppliPath.sh b/bin/appliskel/setAppliPath.sh index d9361ae52..99078065a 100755 --- a/bin/appliskel/setAppliPath.sh +++ b/bin/appliskel/setAppliPath.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # --- retrieve APPLI path, relative to $HOME, set ${APPLI} # on sarge, "which" gives not allways the absolute path...