.bashenv
author Oleksandr Gavenko <gavenkoa@gmail.com>
Tue, 13 Nov 2012 19:01:48 +0200
changeset 589 e1812451b4f8
parent 541 550f4a008534
child 594 521916a26ee2
permissions -rw-r--r--
Fix syntax error.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
280
fc3c78e39407 Move PATH settings to separate file for speedup loading of '.xinitrc'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 279
diff changeset
     1
#!/bin/bash
250
405b343c1214 Add remainder how debug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 242
diff changeset
     2
405b343c1214 Add remainder how debug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 242
diff changeset
     3
# set -x
405b343c1214 Add remainder how debug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 242
diff changeset
     4
# set -u
11
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
# XXX for mc, cvs, svn, ...
179
ed15e30ff41a Set editor to VIM. Bind edit command for shells.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 176
diff changeset
     7
export EDITOR=vim
11
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     9
# XXX vim and gnome-terminal have support for 256 colours in fedora 8 at least
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    10
# Note debian/ubuntu users should install the ncurses-term package to support this
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
# export TERM=xterm-256color
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    12
32
031655c93305 Special case for CYGWIN to properly display russian letters in rxvt.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 30
diff changeset
    13
# Special case for CYGWIN to properly display russian letters in rxvt.
34
cddddb009921 Added useful comment.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 32
diff changeset
    14
# Don't forget set in Windows SHELL=/bin/bash. If default SHELL is sh then .bashrc will not be read.
285
60fc251ec270 Bash string comparison does not require hack.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 280
diff changeset
    15
if [[ $OSTYPE = cygwin ]]; then
258
e3c456cab7ba Use only $OSTYPE to detect Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 257
diff changeset
    16
  export LANG=ru_RU.CP1251
e3c456cab7ba Use only $OSTYPE to detect Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 257
diff changeset
    17
  # Avoid permission problem in Cygwin.
e3c456cab7ba Use only $OSTYPE to detect Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 257
diff changeset
    18
  umask 0000
32
031655c93305 Special case for CYGWIN to properly display russian letters in rxvt.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 30
diff changeset
    19
fi
126
d342461b401b Point PATH, MANPATH, INFOPATH to '~/usr'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 109
diff changeset
    20
300
f7c19d2b4263 Move CDPATH place hold to use it from MC after xinit load...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 299
diff changeset
    21
# Easy cd to often used dirs.
f7c19d2b4263 Move CDPATH place hold to use it from MC after xinit load...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 299
diff changeset
    22
export CDPATH=.:~:~/devel:~/devel/my-devel
f7c19d2b4263 Move CDPATH place hold to use it from MC after xinit load...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 299
diff changeset
    23
279
5845d7aa3ca4 Update paths only once.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 268
diff changeset
    24
if [[ ! $PATH =~ $HOME/usr/bin ]]; then
5845d7aa3ca4 Update paths only once.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 268
diff changeset
    25
  export PATH=$PATH:~/usr/bin
5845d7aa3ca4 Update paths only once.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 268
diff changeset
    26
fi
541
550f4a008534 Add /usr/sbin and /sbin to user PATH.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 480
diff changeset
    27
if [[ ! :$PATH =~ :/usr/sbin ]]; then
550f4a008534 Add /usr/sbin and /sbin to user PATH.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 480
diff changeset
    28
  export PATH=/usr/sbin:$PATH
550f4a008534 Add /usr/sbin and /sbin to user PATH.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 480
diff changeset
    29
fi
550f4a008534 Add /usr/sbin and /sbin to user PATH.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 480
diff changeset
    30
if [[ ! :$PATH =~ :/sbin ]]; then
550f4a008534 Add /usr/sbin and /sbin to user PATH.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 480
diff changeset
    31
  export PATH=/sbin:$PATH
299
2771c1f6f3c5 Add '/usr/sbin' to 'PATH' and '$HOME/usr/lib' to 'LD_LIBRARY_PATH'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 285
diff changeset
    32
fi
2771c1f6f3c5 Add '/usr/sbin' to 'PATH' and '$HOME/usr/lib' to 'LD_LIBRARY_PATH'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 285
diff changeset
    33
2771c1f6f3c5 Add '/usr/sbin' to 'PATH' and '$HOME/usr/lib' to 'LD_LIBRARY_PATH'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 285
diff changeset
    34
if [[ ! $LD_LIBRARY_PATH =~ $HOME/usr/lib ]]; then
2771c1f6f3c5 Add '/usr/sbin' to 'PATH' and '$HOME/usr/lib' to 'LD_LIBRARY_PATH'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 285
diff changeset
    35
  export LD_LIBRARY_PATH=$HOME/usr/lib
2771c1f6f3c5 Add '/usr/sbin' to 'PATH' and '$HOME/usr/lib' to 'LD_LIBRARY_PATH'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 285
diff changeset
    36
else
2771c1f6f3c5 Add '/usr/sbin' to 'PATH' and '$HOME/usr/lib' to 'LD_LIBRARY_PATH'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 285
diff changeset
    37
  export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":$HOME/usr/lib
2771c1f6f3c5 Add '/usr/sbin' to 'PATH' and '$HOME/usr/lib' to 'LD_LIBRARY_PATH'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 285
diff changeset
    38
fi
126
d342461b401b Point PATH, MANPATH, INFOPATH to '~/usr'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 109
diff changeset
    39
265
acd29a6e6d8d Use bash built-in 'test' command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 264
diff changeset
    40
if [[ -z "$MANPATH" ]]; then
126
d342461b401b Point PATH, MANPATH, INFOPATH to '~/usr'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 109
diff changeset
    41
  export MANPATH=~/usr/share/man:
279
5845d7aa3ca4 Update paths only once.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 268
diff changeset
    42
elif [[ ! $MANPATH =~ $HOME/usr/share/man: ]]; then
5845d7aa3ca4 Update paths only once.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 268
diff changeset
    43
  export MANPATH=$MANPATH:$HOME/usr/share/man:
126
d342461b401b Point PATH, MANPATH, INFOPATH to '~/usr'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 109
diff changeset
    44
fi
d342461b401b Point PATH, MANPATH, INFOPATH to '~/usr'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 109
diff changeset
    45
265
acd29a6e6d8d Use bash built-in 'test' command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 264
diff changeset
    46
if [[ -z "$INFOPATH" ]]; then
126
d342461b401b Point PATH, MANPATH, INFOPATH to '~/usr'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 109
diff changeset
    47
  export INFOPATH=~/usr/share/info:
279
5845d7aa3ca4 Update paths only once.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 268
diff changeset
    48
elif [[ ! $INFOPATH =~ $HOME/usr/share/info: ]]; then
5845d7aa3ca4 Update paths only once.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 268
diff changeset
    49
  export INFOPATH=$INFOPATH:$HOME/usr/share/info:
126
d342461b401b Point PATH, MANPATH, INFOPATH to '~/usr'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 109
diff changeset
    50
fi
d342461b401b Point PATH, MANPATH, INFOPATH to '~/usr'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 109
diff changeset
    51
226
97139da73273 Enable python statement readline completion and readline history for interactive Python .
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 221
diff changeset
    52
export PYTHONSTARTUP=~/.pystartup
97139da73273 Enable python statement readline completion and readline history for interactive Python .
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 221
diff changeset
    53