-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathttquickstartenv.csh
96 lines (86 loc) · 2.78 KB
/
ttquickstartenv.csh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#
# Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
#
# Licensed under the Universal Permissive License v 1.0 as shown
# at http://oss.oracle.com/licenses/upl
#
# Oracle TimesTen 22.1 Quick Start Sample Program Environment setup script.
#
set shelltype=`basename "$0"`
if ( ("${shelltype}" != "-tcsh" ) && \
( "${shelltype}" != "tcsh" ) && \
( "${shelltype}" != "-csh" ) && \
( "${shelltype}" != "csh" ) ) then
echo "Please 'source' this script; do not run it as a regular script."
exit 1
endif
#
## Edit and uncomment the line below to have this script automatically
# source the TimesTen environment script.
# #
# # source <tt_instance_home>/bin/ttenv.csh
# #
if ( ! ${?TIMESTEN_HOME} ) then
echo "TIMESTEN_HOME has not been defined. Did you source ttenv.csh?"
set _bad=1
else
set _bad=0
endif
if (! ${_bad} ) then
if ( ! -e "${TIMESTEN_HOME}/bin/ttenv.sh" ) then
echo "TIMESTEN_HOME is not set correctly. Did you source ttenv.csh?"
else
set called=($_)
set cwd=`pwd -P`
set nwd=`dirname "${called[2]}"`
set nfn=`basename "${called[2]}"`
cd "${nwd}" >& /dev/null
if ( $? != 0 ) then
cd "${cwd}"
set _bad=1
else
set nwd=`pwd -P`
if ( -d "${nfn}" ) then
cd "${nfn}" >&/dev/null
if ( $? != 0 ) then
cd "${cwd}"
set _bad=1
else
set nwd=`pwd -P`
setenv QUICKSTART_HOME "${nwd}"
endif
else
setenv QUICKSTART_HOME "${nwd}/${nfn}"
endif
endif
cd "${cwd}"
if (! ${_bad} ) then
setenv QUICKSTART_HOME `dirname "${QUICKSTART_HOME}"`
endif
if ( ! ${?QUICKSTART_HOME} ) then
echo "Unable to determine QuickStart install location"
else
echo
echo "TIMESTEN_HOME=${TIMESTEN_HOME}"
echo
echo "QUICKSTART_HOME=${QUICKSTART_HOME} "
setenv PATH "$QUICKSTART_HOME/sample_code/odbc/bin:$QUICKSTART_HOME/sample_code/jdbc:$QUICKSTART_HOME/sample_code/database:${PATH}"
if (${?CLASSPATH}) then
setenv CLASSPATH "${QUICKSTART_HOME}/sample_code/jdbc:${CLASSPATH}"
else
setenv CLASSPATH "${QUICKSTART_HOME}/sample_code/jdbc"
endif
echo
echo "PATH=${PATH}"
echo
echo "CLASSPATH=${CLASSPATH}"
echo
if (${?TNS_ADMIN}) then
echo "TNS_ADMIN=${TNS_ADMIN}"
else
echo "TNS_ADMIN is not set"
endif
echo
endif
endif
endif