-
Notifications
You must be signed in to change notification settings - Fork 0
/
rc10_environment
50 lines (44 loc) · 1.26 KB
/
rc10_environment
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
# set-up environment varibles that make life good
set -o ignoreeof # prevent ^D from logging out
set -o noclobber # prevent overwrite of files
set bell-style visible # Flash instead of beep
unset TMOUT # prevent autologout
export EXINIT='set ts=4' # vim tabstop
export HOSTNAME=$(uname -n | cut -d. -f1) # hostname sans domain
export PAGER='less -s' # use less as default pager (i.e. for man)
###
# use vi-style command line editing
###
set -o vi
###
# Always use vi as our editor
###
if [[ $(type -P vi) ]]; then
export VISUAL=vi
elif [[ $(type -P vim ) ]]; then
export VISUAL=vim
fi
###
# Set unique history files
###
if [[ ! -d ${HOME}/.history ]]; then
mkdir ${HOME}/.history
fi
export HISTFILE=${HOME}/.history/hist_$$
export HISTSIZE=512
###
# insure that the .ssh directory is protected
###
chmod 700 .ssh 2> /dev/null
###
# Verify we have a valid term, if not redefine it
###
if [[ ! -f /usr/share/terminfo/${TERM:0:1}/${TERM} ]]; then
# this term doesn't exist, see if there's a non-unicode version
if [[ -f /usr/share/terminfo/${TERM:0:1}/${TERM/-unicode} ]]; then
export TERM=${TERM/-unicode}
else
# try xterm or vt
[[ -f /usr/share/terminfo/x/xterm-256color ]] && export TERM=xterm-256color || export TERM=vt220
fi
fi