Changeset 42 for trunk/geomag_profile.sh


Ignore:
Timestamp:
03/25/10 16:46:26 (14 years ago)
Author:
pinsard
Message:

improvements of headers and unset in shell scripts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/geomag_profile.sh

    r40 r42  
    22# 
    33#+ 
    4 # 
    5 # NAME 
    6 # ==== 
    7 # 
    8 # geomag_profile.sh - define GEOMAG environment 
     4# ================= 
     5# geomag_profile.sh 
     6# ================= 
     7# 
     8# ------------------------- 
     9# define GEOMAG environment 
     10# ------------------------- 
    911# 
    1012# SYNOPSIS 
    1113# ======== 
    1214# 
    13 # Online usage 
    14 # 
    15 # :: 
    16 # 
    17 # $ . geomag_profile.sh -d directory -i indir -o outdir -t tempdir 
    18 # 
    19 # In ${HOME}/.profile, add the following line 
    20 # 
    21 # :: 
    22 # 
    23 # . geomag_profile.sh -d directory  -i indir -o outdir -t tempdir 
     15# Online usage:: 
     16# 
     17#  $ . geomag_profile.sh -d directory -i indir -o outdir -t tempdir 
     18# 
     19# In ${HOME}/.profile, add the following line:: 
     20# 
     21#  . geomag_profile.sh -d directory  -i indir -o outdir -t tempdir 
    2422# 
    2523# DESCRIPTION 
     
    4139# ======== 
    4240# 
    43 # For fplod, on aedon.locean-ipsl.upmc.fr: 
    44 # :: 
     41# For fplod, on aedon.locean-ipsl.upmc.fr:: 
    4542# 
    4643#  $ cd /usr/home/fplod/incas/geomag/geomag_ws 
    4744#  $ . geomag_profile.sh -d /usr/home/fplod/incas/geomag/geomag_ws/ -i ${HOME}/geomag_d/ -o ${HOME}/geomag_d/ -t /usr/temp/${LOGNAME}/log/ 
    4845# 
    49 # For reee522 on rhodes.idris.fr: 
    50 # :: 
     46# For reee522 on rhodes.idris.fr:: 
    5147# 
    5248#  $ cd ${HOME}/incas/geomag/geomag_ws/ 
    5349#  $ . geomag_profile.sh -d ${HOME}/incas/geomag/geomag_ws/ -i ${HOMEGAYA}/geomag_d/ -o ${HOMEGAYA}/geomag_d/ -t /tmp/${LOGNAME}/log/ 
    5450# 
    55 # 
    56 # FILES 
    57 # ===== 
    58 # 
    59 # original location 
    60 # ~~~~~~~~~~~~~~~~~ 
    61 # 
    62 # /usr/home/fplod/incas/geomag/geomag_ws/geomag_profile.sh sur aedon.locean-ipsl.upmc.fr 
     51# TODO 
     52# ==== 
     53# 
     54# ++ option bavarde 
     55# 
     56# ++ machine dependant 
     57# 
     58# ++ besoin de posix 
     59# 
     60# ++ pas de MANPATH defini par défaut sur zeus 
    6361# 
    6462# EVOLUTIONS 
    6563# ========== 
    6664# 
    67 # ++ option bavarde 
    68 # 
    69 # ++ machine dependant 
    70 # 
    71 # ++ besoin de posix 
    72 # 
    73 # ++ pas de MANPATH defini par déubt sur zeus 
    74 # 
    7565# $Id$ 
     66# 
     67# - fplod 20100318T073619Z aedon.locean-ipsl.upmc.fr (Darwin) 
     68# 
     69#   * unset 
    7670# 
    7771# - reee522 2007-06-14T14:25:00Z rhodes (IRIX64) 
     
    9993usage=" Usage : ${command} -d directory -i indir -o outdir -t tempdir" 
    10094# 
     95set +u 
    10196while [ ! -z "${1}" ] # ++ pb bash 
    10297do 
     
    120115 
    121116 *) # other choice 
     117  echo "eee : unknown option ${1}" 
    122118  echo "${usage}" 
    123119  # nb : no exit because this file should be launched by login process 
     
    126122 shift # next flag 
    127123done 
    128  
     124unset usage 
     125# 
     126set -u 
     127# 
    129128# check for ${directory} 
    130129if [ ! -d ${directory} ] 
     
    151150;; 
    152151esac 
     152unset system 
    153153# 
    154154GEOMAG=${directory} 
    155155export GEOMAG 
     156unset directory 
    156157# 
    157158# add GEOMAG tools to PATH 
     
    167168   echo "${command} : iii : ${GEOMAG}/ already in \${PATH}" 
    168169fi 
     170unset test_path 
    169171# 
    170172# add GEOMAG manuals to MANPATH 
     
    174176if [ ${test_manpath} -ne 0 ] 
    175177then 
    176    MANPATH=${GEOMAG}/man/:${MANPATH} 
     178   MANPATH=${GEOMAG}/doc/manuals/man/:${MANPATH} 
    177179   export MANPATH 
    178180else 
    179181   # option bavarde oui/non pas encore implantée ++ 
    180    echo "${command} : iii : ${GEOMAG}/man/ already in \${MANPATH}" 
    181 fi 
     182   echo "${command} : iii : ${GEOMAG}/doc/manuals/man/ already in \${MANPATH}" 
     183fi 
     184unset test_manpath 
    182185# 
    183186GEOMAG_LOG=${tempdir} 
    184187export GEOMAG_LOG 
     188unset tempdir 
    185189if [ ! -d ${GEOMAG_LOG} ] 
    186190then 
     
    208212GEOMAG_ID=${indir} 
    209213export GEOMAG_ID 
     214unset indir 
    210215if [ ! -d ${GEOMAG_ID} ] 
    211216then 
     
    222227GEOMAG_OD=${outdir} 
    223228export GEOMAG_OD 
     229unset outdir 
    224230if [ ! -d ${GEOMAG_OD} ] 
    225231then 
     
    240246# 
    241247# end 
     248unset command 
    242249# nb : no exit because this file should be launched by login process 
Note: See TracChangeset for help on using the changeset viewer.