Ignore:
Timestamp:
04/14/10 16:38:53 (14 years ago)
Author:
pinsard
Message:

indent shell scripts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/superbib_profile.sh

    r95 r100  
    1313# ======== 
    1414# 
    15 # Online usage  
    16 #  
    17 # :: 
    18 # 
    19 # $ . ./superbib_profile.sh -d directory -i indir -o outdir -t tempdir 
    20 # 
    21 # In ${HOME}/.profile, add the following line  
    22 # 
    23 # :: 
    24 # 
    25 # . superbib_profile.sh -d directory  -i indir -o outdir -t tempdir 
     15# Online usage :: 
     16# 
     17#  $ . ./superbib_profile.sh -d directory -i indir -o outdir -t tempdir 
     18# 
     19# In ${HOME}/.profile, add the following line :: 
     20# 
     21#  . superbib_profile.sh -d directory  -i indir -o outdir -t tempdir 
    2622# 
    2723# DESCRIPTION 
     
    4339# ======== 
    4440# 
    45 # For fplod, on aedon.locean-ipsl.upmc.fr: 
    46 # 
    47 # :: 
    48 # 
    49 #  $ cd /usr/home/fplod/src/superbib/superbib_ws/src/ 
    50 #  $ . ./superbib_profile.sh \ 
     41# For fplod, on aedon.locean-ipsl.upmc.fr:: 
     42# 
     43#  $ cd /usr/home/fplod/src/superbib/superbib_ws/ 
     44#  $ . ./src/superbib_profile.sh \ 
    5145#    -d $(pwd) \ 
    5246#    -i /usr/temp/${LOGNAME}/superbib_d/ \ 
     
    5953# ++ option bavarde 
    6054# 
    61 # ++ machine dependant  
    62 #  
     55# ++ machine dependant 
     56# 
    6357# ++ compilateur dependant 
    6458# 
    65 # ++ pas de MANPATH defini par défaut sur zeus 
     59# ++ pas de MANPATH defini par defaut sur zeus 
    6660# 
    6761# EVOLUTIONS 
     
    7771system=$(uname) 
    7872case "${system}" in 
    79  AIX|IRIX64) 
    80   echo " www : no specific posix checking" 
    81  ;; 
    82  *) 
    83   set -o posix 
    84  ;; 
     73   AIX|IRIX64) 
     74      echo " www : no specific posix checking" 
     75   ;; 
     76   *) 
     77      set -o posix 
     78   ;; 
    8579esac 
     80unset system 
    8681# 
    8782# as this script might be launch in .profile, command is forced. 
     
    9287while [ ! -z "${1}" ] # ++ pb bash 
    9388do 
    94  case ${1} in 
    95  -d) # directory for application choosen by user (see svn checkout command used) 
    96   directory=${2} 
    97   shift 
    98  ;; 
    99  -i) # directory for inputs choosen by user 
    100   indir=${2} 
    101   shift 
    102  ;; 
    103  -o) # directory for outputs choosen by user 
    104   outdir=${2} 
    105   shift 
    106  ;; 
    107  -t) # directory for temporary outputs choosen by user 
    108   tempdir=${2} 
    109   shift 
    110  ;; 
    111  *) # other choice 
    112   echo "${usage}" 
    113   # nb : no exit because this file should be launched by login process 
    114  ;; 
    115  esac 
    116  shift # next flag 
     89   case ${1} in 
     90      -d) # directory for application choosen by user (see svn checkout command used) 
     91         directory=${2} 
     92         shift 
     93      ;; 
     94      -i) # directory for inputs choosen by user 
     95         indir=${2} 
     96         shift 
     97      ;; 
     98      -o) # directory for outputs choosen by user 
     99         outdir=${2} 
     100         shift 
     101      ;; 
     102      -t) # directory for temporary outputs choosen by user 
     103         tempdir=${2} 
     104         shift 
     105      ;; 
     106      *) # other choice 
     107        echo "eee : unknown option ${1}" 
     108        echo "${usage}" 
     109        # nb : no exit because this file should be launched by login process 
     110      ;; 
     111   esac 
     112   shift # next flag 
    117113done 
     114unset usage 
    118115# 
    119116# check for ${directory} 
    120117if [ ! -d ${directory} ] 
    121118then 
    122  echo " eee : ${directory} not found" 
    123  # nb : no exit because this file should be launched by login process 
     119   echo " eee : ${directory} not found" 
     120   # nb : no exit because this file should be launched by login process 
    124121fi 
    125122# 
     
    127124if [ ! -x ${directory} ] 
    128125then 
    129  echo " eee : ${directory} not reachable" 
    130  # nb : no exit because this file should be launched by login process 
    131 fi 
    132 # 
    133 system=$(uname) 
     126   echo " eee : ${directory} not reachable" 
     127   # nb : no exit because this file should be launched by login process 
     128fi 
    134129# 
    135130SUPERBIB=${directory} 
     
    148143   echo "${command} : iii : ${SUPERBIB}/ already in \${PATH}" 
    149144fi 
     145unset test_path 
    150146# 
    151147# add SUPERBIB manuals to MANPATH 
     
    155151if [ ${test_manpath} -ne 0 ] 
    156152then 
    157    MANPATH=${SUPERBIB}/man/:${MANPATH} 
     153   MANPATH=${SUPERBIB}/doc/manuals/man/:${MANPATH} 
    158154   export MANPATH 
    159155else 
    160156   # option bavarde oui/non pas encore implantée ++ 
    161    echo "${command} : iii : ${SUPERBIB}/man/ already in \${MANPATH}" 
    162 fi 
     157   echo "${command} : iii : ${SUPERBIB}/doc/manuals/man/ already in \${MANPATH}" 
     158fi 
     159unset test_manpath 
    163160# 
    164161SUPERBIB_LOG=${tempdir} 
    165162export SUPERBIB_LOG 
    166 if [ ! -d ${SUPERBIB_LOG} ]  
    167 then 
    168   mkdir -p ${SUPERBIB_LOG} 
    169   echo "${command} : iii : creation of \${SUPERBIB_LOG}" 
    170 fi  
     163unset tempdir 
     164if [ ! -d ${SUPERBIB_LOG} ] 
     165then 
     166   mkdir -p ${SUPERBIB_LOG} 
     167   echo "${command} : iii : creation of \${SUPERBIB_LOG}" 
     168fi 
    171169# check for permission on SUPERBIB_LOG 
    172170if [ ! -x ${SUPERBIB_LOG} ] 
    173171then 
    174  echo " eee : ${SUPERBIB_LOG} not reachable" 
    175  # nb : no exit because this file should be launched by login process 
     172  echo " eee : ${SUPERBIB_LOG} not reachable" 
     173  # nb : no exit because this file should be launched by login process 
    176174fi 
    177175# 
     
    179177if [ ! -w ${SUPERBIB_LOG} ] 
    180178then 
    181  echo " eee : ${SUPERBIB_LOG} not writable" 
    182  # nb : no exit because this file shouldreachable be launched by login process 
     179   echo " eee : ${SUPERBIB_LOG} not writable" 
     180   # nb : no exit because this file shouldreachable be launched by login process 
    183181fi 
    184182# 
     
    189187SUPERBIB_ID=${indir} 
    190188export SUPERBIB_ID 
    191 if [ ! -d ${SUPERBIB_ID} ]  
    192 then 
    193   mkdir -p ${SUPERBIB_ID} 
    194   echo "${command} : iii : creation of \${SUPERBIB_ID}" 
    195 fi  
     189unset indir 
     190if [ ! -d ${SUPERBIB_ID} ] 
     191then 
     192   mkdir -p ${SUPERBIB_ID} 
     193   echo "${command} : iii : creation of \${SUPERBIB_ID}" 
     194fi 
    196195# check for permission on SUPERBIB_ID 
    197196if [ ! -x ${SUPERBIB_ID} ] 
    198197then 
    199  echo " eee : ${SUPERBIB_ID} not reachable" 
    200  # nb : no exit because this file should be launched by login process 
     198   echo " eee : ${SUPERBIB_ID} not reachable" 
     199   # nb : no exit because this file should be launched by login process 
    201200fi 
    202201# 
    203202SUPERBIB_OD=${outdir} 
    204203export SUPERBIB_OD 
     204unset outdir 
    205205if [ ! -d ${SUPERBIB_OD} ] 
    206206then 
    207   mkdir -p ${SUPERBIB_OD} 
    208   echo "${command} : iii : creation of \${SUPERBIB_OD}" 
     207    mkdir -p ${SUPERBIB_OD} 
     208    echo "${command} : iii : creation of \${SUPERBIB_OD}" 
    209209fi 
    210210# check for permission on SUPERBIB_OD 
    211211if [ ! -x ${SUPERBIB_OD} ] 
    212212then 
    213  echo " eee : ${SUPERBIB_OD} not reachable" 
    214  # nb : no exit because this file should be launched by login process 
     213   echo " eee : ${SUPERBIB_OD} not reachable" 
     214   # nb : no exit because this file should be launched by login process 
    215215fi 
    216216if [ ! -w ${SUPERBIB_OD} ] 
    217217then 
    218  echo " eee : ${SUPERBIB_OD} not writable" 
    219  # nb : no exit because this file should be launched by login process 
     218   echo " eee : ${SUPERBIB_OD} not writable" 
     219   # nb : no exit because this file should be launched by login process 
    220220fi 
    221221# 
    222222# end 
     223unset command 
    223224# nb : no exit because this file should be launched by login process 
Note: See TracChangeset for help on using the changeset viewer.