-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtools
More file actions
64 lines (50 loc) · 1.16 KB
/
Copy pathtools
File metadata and controls
64 lines (50 loc) · 1.16 KB
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
#!/bin/bash
# locate this script:
SCRIPT="${BASH_SOURCE[0]}"
SCRIPTDIR=""
if [ -z "$SCRIPT" ]; then
SCRIPT=$(readlink -f $0)
SCRIPTDIR=$(dirname $SCRIPT)
else
SCRIPTDIR="$( cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 ; pwd -P )"
fi
# check if this script has been sourced
([[ -n $ZSH_EVAL_CONTEXT && $ZSH_EVAL_CONTEXT =~ :file$ ]] ||
[[ -n $KSH_VERSION && $(cd "$(dirname -- "$0")" &&
printf '%s' "${PWD%/}/")$(basename -- "$0") != "${.sh.file}" ]] ||
[[ -n $BASH_VERSION ]] && (return 0 2>/dev/null)) && sourced=1 || sourced=0
if (( $sourced == 0 )) ; then
echo "Please only source this script."
exit 1;
fi
echo "Everything is ready to go!"
function tstart {
source halenv/bin/activate
}
function thome {
cd $SCRIPTDIR
}
function thelp {
cat $SCRIPTDIR/term_intro
}
function treadme {
xdg-open $SCRIPTDIR/README.html
}
function t01 {
cd $SCRIPTDIR/01-firststeps
}
function t02 {
cd $SCRIPTDIR/02-interact
}
function t03 {
cd $SCRIPTDIR/03-bugs
}
function tc01 {
cd $SCRIPTDIR/01-firststeps-cheat
}
function tc02 {
cd $SCRIPTDIR/02-interact-cheat
}
function tc03 {
cd $SCRIPTDIR/03-bugs-cheat
}