source: trunk/geomag_profile.sh @ 17

Last change on this file since 17 was 17, checked in by pinsard, 17 years ago

remove xxx_oneplot.pro and for_createpro.pro which are not supposed to be here : They interfere with xxx temporary files in myuniquetmpdir

  • Property svn:executable set to *
  • Property svn:keyword set to Id
File size: 2.9 KB
Line 
1# !/bin/sh -xv
2#
3# module :
4# define GEOMAG environnement
5#
6# usage :
7# online usage
8# $ . geomag_profile.sh -d directory
9#
10# in ${HOME}/.profile, add the following line
11# . geomag_profile.sh -d directory
12#
13# examples :
14# for fplod, on aedon.locean-ipsl.upmc.fr
15# $ cd /usr/home/fplod/incas/geomag/geomag_ws
16# $  . geomag_profile.sh -d /usr/home/fplod/incas/geomag/geomag_ws/
17# for reee522 on rhodes.idris.fr
18# $ cd ${HOME}/incas/geomag/geomag_ws/
19# $ . geomag_profile.sh -d ${HOME}/incas/geomag/geomag_ws/
20#
21# original location
22# geomag_profile.sh sur aedon.lodyc.jussieu.fr
23#
24# update :
25# ++ option bavarde
26# ++ machine dependant
27# ++ besoin de posix
28# ++ pas de MANPATH defini par déut sur zeus
29# fplod 2007-03-13T16:12:41Z zeus.locean-ipsl.upmc.fr (Linux)
30# add creation of $GEOMAG_ID and $GEOMAG_OD if they don't exist
31# reee522 2006-11-23T11:41:41Z rhodes (IRIX64)
32# pas de set -o posix sur rhodes (IRIX64)
33# $Id$
34# fplod 2006-03-22T10:13:38Z aedon.lodyc.jussieu.fr (Darwin)
35# creation
36#
37#
38command=geomag_profile.sh
39#
40usage=" Usage : ${command} -d directory"
41#
42while [ ! -z "${1}" ] # ++ pb bash
43do
44 case ${1} in
45 -d) # directory choosen by user
46  directory=${2}
47  shift
48 ;;
49 *) # other choice
50  echo "${usage}"
51  # nb : no exit because this file should be launched by login process
52 ;;
53 esac
54 shift # next flag
55done
56
57# check for ${directory}
58if [ ! -d ${directory} ]
59then
60 echo " eee : ${directory} not found"
61 # nb : no exit because this file should be launched by login process
62fi
63#
64# check for permission on directory
65if [ ! -x ${directory} ]
66then
67 echo " eee : ${directory} not reachable"
68 # nb : no exit because this file should be launched by login process
69fi
70#
71set -u
72system=$(uname)
73case ${system} in
74IRIX64)
75  echo " www : no specific posix checking"
76;;
77*)
78  set -o posix
79;;
80esac
81#
82#
83GEOMAG=${directory}
84export GEOMAG
85#
86# add GEOMAG tools to PATH
87# if not already done
88echo ${PATH} | grep -q ${GEOMAG}
89test_path=${?}
90if [ ${test_path} -ne 0 ]
91then
92   PATH=${GEOMAG}/:${PATH}
93   export PATH
94else
95   # option bavarde oui/non pas encore implantée ++
96   echo "${command} : iii : ${GEOMAG}/ already in \${PATH}"
97fi
98#
99# add GEOMAG manuals to MANPATH
100# if not already done
101echo ${MANPATH} | grep -q ${GEOMAG}
102test_manpath=${?}
103if [ ${test_manpath} -ne 0 ]
104then
105   MANPATH=${GEOMAG}/man/:${MANPATH}
106   export MANPATH
107else
108   # option bavarde oui/non pas encore implantée ++
109   echo "${command} : iii : ${GEOMAG}/man/ already in \${MANPATH}"
110fi
111#
112GEOMAG_LOG=/usr/temp/${LOGNAME}/log/
113export GEOMAG_LOG
114#
115EDITOR=vi
116export EDITOR
117#
118# io directories
119GEOMAG_ID=${HOME}/geomag_d/
120export GEOMAG_ID
121if [ ! -d ${GEOMAG_ID} ] 
122then
123  mkdir -p ${GEOMAG_ID}
124  echo "${command} : iii : creation of \${GEOMAG_ID}"
125fi
126GEOMAG_OD=${HOME}/geomag_d/
127export GEOMAG_OD
128if [ ! -d ${GEOMAG_ID} ]
129then
130  mkdir -p ${GEOMAG_OD}
131  echo "${command} : iii : creation of \${GEOMAG_OD}"
132fi
133#
134# end
135# nb : no exit because this file should be launched by login process
Note: See TracBrowser for help on using the repository browser.