2
# @(#)setmidas.sh 19.1 (ESO-IPG) 02/25/03 14:32:00
3
# .COPYRIGHT: Copyright (c) 1988 European Southern Observatory,
7
# .LANGUAGE Bourne-shell script
8
# .ENVIRONMENT Unix Systems. Executable ONLY under "sh" or "bash" with the
10
# .USAGE . <path_name>/setmidas.sh
11
# It can be simplified with an environment definition:
12
# setmidas=". <path_name>/setmidas.sh"
13
# and executed as $setmidas.
14
# .COMMENTS Interface to the MIDAS environment. It sets the variables
15
# MIDASHOME, MIDVERS, MIDOPTION & MIDWORK for the next script
18
# .REMARKS This file helps users to chose between several releases of
19
# MIDAS. It is not necessary if you have only one release of
22
# .REMARKS MIDASHOME0 & MIDVERS0 are set to defaults values by option
23
# "8- MIDAS setup" in the MIDAS "config" script.
25
# .VERSION 1.1 910221: CG. Implementation
26
# .VERSION 2.1 930706: CG. Adding options
27
#-------------------------------------------------------------------------
29
#**************************************************************************
32
# Modify the values of MIDVERS? and MIDASHOME? accordingly to your site.
33
# MIDVERS0 and MIDASHOME0 represents the default release of MIDAS.
35
# Other releases of MIDAS can be invoked from here by setting MIDVERS[123]
37
# MIDVERS0: Release of MIDAS by default. Cumpulsory.
40
MIDASHOME0=/auto/home/ns2b/midas
42
# Other MIDAS releases here. Set them in comments if you do not use them
53
# END of Configure Here
54
#**************************************************************************
55
export MIDASHOME MIDVERS MIDOPTION MID_WORK
61
if [ "`echo -n `" = "-n" ]; then
68
# Check MIDVERS0 variable is defined.
70
if [ -z "$MIDVERS0" ]; then
71
echo "MIDVERS0: Undefined variable."
72
echo "File <setmidas.sh> must contain this definition."
73
echo "Call your MIDAS operator. EXIT."
74
shift >/dev/null 2>&1 # Equivalent to exit
78
# Check MIDASHOME0 variable is defined.
80
if [ -z "$MIDASHOME0" ]; then
81
echo "MIDASHOME0: Undefined variable."
82
echo "File <setmidas.sh> must contain this definition."
83
echo "Call your MIDAS operator. EXIT."
84
shift >/dev/null 2>&1 # Equivalent to exit
88
# Here comes output-text
90
VERS_AVAIL="Versions of MIDAS available: $MIDVERS0 $MIDVERS1 $MIDVERS2 $MIDVERS3"
91
ENTER_VERS="Enter MIDAS version (default="
92
OPT_AVAIL="MIDAS option: PARALLEL, NOPARALLEL"
93
ENTER_OPT="Enter MIDAS option (default="
94
DEF_WORK="Default MIDAS startup directory= "
95
ENTER_WORK="Enter MIDAS startup directory: "
98
# If MIDVERS variable not defined then set to default.
100
if [ -z "$MIDVERS" ]; then
105
# Check MIDAS versions:
106
# If none of them then set to default.
111
MIDASHOME=$MIDASHOME0
115
MIDASHOME=$MIDASHOME1
119
MIDASHOME=$MIDASHOME2
123
MIDASHOME=$MIDASHOME3
127
MIDASHOME=$MIDASHOME0
132
# Check for another MIDVERS
138
$necho ${ENTER_VERS}${MIDVERS}"): " $SV_NONL
141
case "$NEWMIDVERS" in
146
MIDASHOME=$MIDASHOME0
150
MIDASHOME=$MIDASHOME1
154
MIDASHOME=$MIDASHOME2
158
MIDASHOME=$MIDASHOME3
168
# MIDOPTION set to default
170
if [ "$MIDOPTION" != "PARALLEL" ]; then
178
$necho ${ENTER_OPT}${MIDOPTION}"): " $SV_NONL
198
# MID_WORK set to default
200
if [ -z "$MID_WORK" ]; then
201
MID_WORK=$HOME/midwork
205
echo ${DEF_WORK}${MID_WORK}
206
$necho ${ENTER_WORK} $SV_NONL