#! /bin/sh -x #+ # NAME # ==== # # ircaam_profile.sh - define IRCAAM environnement # # SYNOPSYS # ======== # # # Online usage # :: # # $ . ./ircaam_profile.sh -d directory -i indir -o outdir -t tempdir # # In ${HOME}/.profile, add the following line # :: # # . ircaam_profile.sh -d directory -i indir -o outdir -t tempdir # # DESCRIPTION # =========== # # define IRCAAM environnement # # # ${IRCAAM} # # ${IRCAAM_LOG} ++ # # ${IRCAAM_ID} # # ${IRCAAM_OD} # # MANPATH++ # # EXAMPLES # ======== # # # For fplod, on aedon.locean-ipsl.upmc.fr: # # :: # # $ cd /usr/home/fplod/incas/ircaam/ircaam_ws/src/ # $ . ./ircaam_profile.sh \ # -d $(pwd) \ # -i /usr/temp/${LOGNAME}/ircaam_d/ \ # -o /usr/temp/${LOGNAME}/ircaam_d/ \ # -t /usr/temp/${LOGNAME}/log/ # # For fplod on zeus.locean-ipsl.umpc.fr: # # :: # # $ cd ${HOME}/incas/ircaam/ircaam_ws/src/ # $ . ./ircaam_profile.sh \ # -d $(pwd) \ # -i /usr/temp/${LOGNAME}/ircaam_d/ \ # -o /usr/temp/${LOGNAME}/ircaam_d/ \ # -t /usr/temp/${LOGNAME}/log/ # # FILES # ===== # # original location # ~~~~~~~~~~~~~~~~~ # # /usr/home/fplod/incas/ircaam/ircaam_ws/src/ircaam_profile.sh sur aedon.locean-ipsl.upmc.fr # # # TODO # ==== # # matlab/octave path # # EVOLUTIONS # ========== # # ++ option bavarde # # ++ machine dependant # # ++ besoin de posix # # ++ pas de MANPATH defini par défaut sur zeus # # ++ climserv # # $Id$ # # - fplod 2008-08-14T12:28:16Z aedon.locean-ipsl.upmc.fr (Darwin) # # * move all \*.sh and \*.pro files to src/ # # - fplod 2008-07-21T10:58:47Z aedon.locean-ipsl.upmc.fr (Darwin) # # * creation # #- system=$(uname) case "${system}" in AIX|IRIX64) echo " www : no specific posix checking" ;; *) set -o posix ;; esac # # as this script might be launch in .profile, command is forced. command=ircaam_profile.sh # usage=" Usage : ${command} -d directory -i indir -o outdir -t tempdir" # while [ ! -z "${1}" ] # ++ pb bash do case ${1} in -d) # directory for application choosen by user (see svn checkout command used) directory=${2} shift ;; -i) # directory for inputs choosen by user indir=${2} shift ;; -o) # directory for outputs choosen by user outdir=${2} shift ;; -t) # directory for temporary outputs choosen by user tempdir=${2} shift ;; *) # other choice echo "${usage}" # nb : no exit because this file should be launched by login process ;; esac shift # next flag done # # check for ${directory} if [ ! -d ${directory} ] then echo " eee : ${directory} not found" # nb : no exit because this file should be launched by login process fi # # check for permission on directory if [ ! -x ${directory} ] then echo " eee : ${directory} not reachable" # nb : no exit because this file should be launched by login process fi # set -u system=$(uname) case "${system}" in IRIX64) echo " www : no specific posix checking" ;; *) set -o posix ;; esac # IRCAAM=${directory} export IRCAAM # # add IRCAAM tools to PATH # if not already done echo ${PATH} | grep -q ${IRCAAM} test_path=${?} if [ ${test_path} -ne 0 ] then PATH=${IRCAAM}/:${PATH} export PATH else # option bavarde oui/non pas encore implantée ++ echo "${command} : iii : ${IRCAAM}/ already in \${PATH}" fi # # add IRCAAM manuals to MANPATH # if not already done echo ${MANPATH} | grep -q ${IRCAAM} test_manpath=${?} if [ ${test_manpath} -ne 0 ] then MANPATH=${IRCAAM}/man/:${MANPATH} export MANPATH else # option bavarde oui/non pas encore implantée ++ echo "${command} : iii : ${IRCAAM}/man/ already in \${MANPATH}" fi # IRCAAM_LOG=${tempdir} export IRCAAM_LOG if [ ! -d ${IRCAAM_LOG} ] then mkdir -p ${IRCAAM_LOG} echo "${command} : iii : creation of \${IRCAAM_LOG}" fi # check for permission on IRCAAM_LOG if [ ! -x ${IRCAAM_LOG} ] then echo " eee : ${IRCAAM_LOG} not reachable" # nb : no exit because this file should be launched by login process fi # # check for permission on IRCAAM_LOG if [ ! -w ${IRCAAM_LOG} ] then echo " eee : ${IRCAAM_LOG} not writable" # nb : no exit because this file shouldreachable be launched by login process fi # EDITOR=vi export EDITOR # # io directories IRCAAM_ID=${indir} export IRCAAM_ID if [ ! -d ${IRCAAM_ID} ] then mkdir -p ${IRCAAM_ID} echo "${command} : iii : creation of \${IRCAAM_ID}" fi # check for permission on IRCAAM_ID if [ ! -x ${IRCAAM_ID} ] then echo " eee : ${IRCAAM_ID} not reachable" # nb : no exit because this file should be launched by login process fi # IRCAAM_OD=${outdir} export IRCAAM_OD if [ ! -d ${IRCAAM_OD} ] then mkdir -p ${IRCAAM_OD} echo "${command} : iii : creation of \${IRCAAM_OD}" fi # check for permission on IRCAAM_OD if [ ! -x ${IRCAAM_OD} ] then echo " eee : ${IRCAAM_OD} not reachable" # nb : no exit because this file should be launched by login process fi if [ ! -w ${IRCAAM_OD} ] then echo " eee : ${IRCAAM_OD} not writable" # nb : no exit because this file should be launched by login process fi # # end # nb : no exit because this file should be launched by login process