Changeset 26


Ignore:
Timestamp:
06/14/07 16:52:57 (17 years ago)
Author:
pinsard
Message:

add parameters for io and temp in geomag_profile.sh. required for working on IDRIS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/geomag_profile.sh

    r17 r26  
    66# usage : 
    77# online usage 
    8 # $ . geomag_profile.sh -d directory 
     8# $ . geomag_profile.sh -d directory -i indir -o outdir -t tempdir 
    99# 
    1010# in ${HOME}/.profile, add the following line 
    11 # . geomag_profile.sh -d directory 
     11# . geomag_profile.sh -d directory  -i indir -o outdir -t tempdir 
    1212# 
    1313# examples : 
    14 # for fplod, on aedon.locean-ipsl.upmc.fr 
     14# for fplod, on aedon.locean-ipsl.upmc.fr  
    1515# $ cd /usr/home/fplod/incas/geomag/geomag_ws 
    16 # $  . geomag_profile.sh -d /usr/home/fplod/incas/geomag/geomag_ws/ 
     16# $  . geomag_profile.sh -d /usr/home/fplod/incas/geomag/geomag_ws/ -i ${HOME}/geomag_d/ -o ${HOME}/geomag_d/ -t /usr/temp/${LOGNAME}/log/ 
     17# 
    1718# for reee522 on rhodes.idris.fr 
    1819# $ cd ${HOME}/incas/geomag/geomag_ws/ 
    19 # $ . geomag_profile.sh -d ${HOME}/incas/geomag/geomag_ws/ 
     20# $ . geomag_profile.sh -d ${HOME}/incas/geomag/geomag_ws/ -i ${HOMEGAYA}/geomag_d/ -o ${HOMEGAYA}/geomag_d/ -t /tmp/${LOGNAME}/log/ 
    2021# 
    2122# original location 
     
    2627# ++ machine dependant 
    2728# ++ besoin de posix 
    28 # ++ pas de MANPATH defini par déut sur zeus 
     29# ++ pas de MANPATH defini par déubt sur zeus 
     30# reee522 2007-06-14T14:25:00Z rhodes (IRIX64) 
     31# add -i, -o and -t parameters to be more flexible 
     32# some bug fixes 
     33# more checking 
    2934# fplod 2007-03-13T16:12:41Z zeus.locean-ipsl.upmc.fr (Linux) 
    3035# add creation of $GEOMAG_ID and $GEOMAG_OD if they don't exist 
     
    3843command=geomag_profile.sh 
    3944# 
    40 usage=" Usage : ${command} -d directory" 
     45usage=" Usage : ${command} -d directory -i indir -o outdir -t tempdir" 
    4146# 
    4247while [ ! -z "${1}" ] # ++ pb bash 
    4348do 
    4449 case ${1} in 
    45  -d) # directory choosen by user 
     50 -d) # directory for application choosen by user (see svn checkout command used) 
    4651  directory=${2} 
    4752  shift 
    4853 ;; 
     54 -i) # directory for inputs choosen by user 
     55  indir=${2} 
     56  shift 
     57 ;; 
     58 -o) # directory for outputs choosen by user 
     59  outdir=${2} 
     60  shift 
     61 ;; 
     62 -t) # directory for temporary outputs choosen by user 
     63  tempdir=${2} 
     64  shift 
     65 ;; 
     66 
    4967 *) # other choice 
    5068  echo "${usage}" 
     
    7189set -u 
    7290system=$(uname) 
    73 case ${system} in 
     91case "${system}" in 
    7492IRIX64) 
    7593  echo " www : no specific posix checking" 
     
    7997;; 
    8098esac 
    81 # 
    8299# 
    83100GEOMAG=${directory} 
     
    110127fi 
    111128# 
    112 GEOMAG_LOG=/usr/temp/${LOGNAME}/log/ 
     129GEOMAG_LOG=${tempdir} 
    113130export GEOMAG_LOG 
     131if [ ! -d ${GEOMAG_LOG} ]  
     132then 
     133  mkdir -p ${GEOMAG_LOG} 
     134  echo "${command} : iii : creation of \${GEOMAG_LOG}" 
     135fi  
     136# check for permission on GEOMAG_LOG 
     137if [ ! -x ${GEOMAG_LOG} ] 
     138then 
     139 echo " eee : ${GEOMAG_LOG} not reachable" 
     140 # nb : no exit because this file should be launched by login process 
     141fi 
     142# 
     143# check for permission on GEOMAG_LOG 
     144if [ ! -w ${GEOMAG_LOG} ] 
     145then 
     146 echo " eee : ${GEOMAG_LOG} not writable" 
     147 # nb : no exit because this file shouldreachable be launched by login process 
     148fi 
    114149# 
    115150EDITOR=vi 
     
    117152# 
    118153# io directories 
    119 GEOMAG_ID=${HOME}/geomag_d/ 
     154GEOMAG_ID=${indir} 
    120155export GEOMAG_ID 
    121156if [ ! -d ${GEOMAG_ID} ]  
     
    124159  echo "${command} : iii : creation of \${GEOMAG_ID}" 
    125160fi  
    126 GEOMAG_OD=${HOME}/geomag_d/ 
     161# check for permission on GEOMAG_ID 
     162if [ ! -x ${GEOMAG_ID} ] 
     163then 
     164 echo " eee : ${GEOMAG_ID} not reachable" 
     165 # nb : no exit because this file should be launched by login process 
     166fi 
     167# 
     168GEOMAG_OD=${outdir} 
    127169export GEOMAG_OD 
    128 if [ ! -d ${GEOMAG_ID} ] 
     170if [ ! -d ${GEOMAG_OD} ] 
    129171then 
    130172  mkdir -p ${GEOMAG_OD} 
    131173  echo "${command} : iii : creation of \${GEOMAG_OD}" 
    132174fi 
     175# check for permission on GEOMAG_OD 
     176if [ ! -x ${GEOMAG_OD} ] 
     177then 
     178 echo " eee : ${GEOMAG_OD} not reachable" 
     179 # nb : no exit because this file should be launched by login process 
     180fi 
     181if [ ! -w ${GEOMAG_OD} ] 
     182then 
     183 echo " eee : ${GEOMAG_OD} not writable" 
     184 # nb : no exit because this file should be launched by login process 
     185fi 
    133186# 
    134187# end 
Note: See TracChangeset for help on using the changeset viewer.