-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
executable file
·43 lines (38 loc) · 1.06 KB
/
.bashrc
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
#!/usr/bin/env bash
# -*- coding:utf-8 -*-
# debugging:
# set -x
# stop on error:
# set -e
readFile() {
if [ -f ${1} ]; then
source ${1}
else
echo "ERROR: File not found: ${1}"
#exit 1
fi
}
# can't be local - local: can only be used in a function
bash_profile=${HOME}/.bash_profile
if [ -z ${dotfilesHOME} ]; then
source ${bash_profile}
# TODO make sure ~/.bashrc is not executed twice, eg in a loop:
# ~/.bashrc -> ~/.bash_profile -> ~/.bashrc
fi
if [ ! -d ${dotfilesHOME} ]; then
echo "ERROR: Directory doesn't exits: dotfilesHOME=${dotfilesHOME}"
echo "Check the ${bash_profile}"
return
else
# can't be local - local: can only be used in a function
bash_files=${dotfilesHOME}/bash
readFile ${bash_files}/env
readFile ${bash_files}/aliases
fi
# TODO try history-search-backward "\e[A", history-search-forward "\e[B"
#"\e[A": history-search-backward
#"\e[B": history-search-forward
#set show-all-if-ambiguous on
#set completion-ignore-case on
# export PATH=~/.local/bin:${PATH}
unset JAVA_TOOL_OPTIONS