forked from dsindex/blog
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathenv.sh
66 lines (56 loc) · 1.13 KB
/
env.sh
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
#!/bin/bash
set -o errexit
export LC_ALL=ko_KR.UTF-8
export LANG=ko_KR.UTF-8
# directory
## current dir of this script
CDIR=$(readlink -f $(dirname $(readlink -f ${BASH_SOURCE[0]})))
PDIR=$(readlink -f $(dirname $(readlink -f ${BASH_SOURCE[0]}))/..)
IRSTLM=/usr/local/irstlm/bin
DOC=../doc.txt
DICT=dict
NGRAM=ngram
LM=lm
iARPA=iarpa_lm
qARPA=qarpa_lm
ARPA=arpa_lm
SPLIT=8
NGRAM_SIZE=2
KENLM=../package/kenlm/bin
# command setting
python='/usr/local/bin/python2.7'
pig='pig'
hls='hadoop fs -ls'
hget='hadoop fs -get'
hmkdir='hadoop fs -mkdir'
hrm='hadoop fs -rm -skipTrash'
hrmr='hadoop fs -rm -r -skipTrash'
hmv='hadoop fs -mv'
hcp='hadoop fs -cp'
hcat='hadoop fs -cat'
hput='hadoop fs -copyFromLocal'
htest='hadoop fs -test -e'
htestd='hadoop fs -test -d'
hmerge='hadoop fs -getmerge'
hdu='hadoop fs -du'
# functions
function make_calmness()
{
exec 3>&2 # save 2 to 3
exec 2> /dev/null
}
function revert_calmness()
{
exec 2>&3 # restore 2 from previous saved 3(originally 2)
}
function close_fd()
{
exec 3>&-
}
function jumpto
{
label=$1
cmd=$(sed -n "/$label:/{:a;n;p;ba};" $0 | grep -v ':$')
eval "$cmd"
exit
}