Mercurial > hg > cc > cirrus_home
annotate .bashrc @ 157:cac9586291ad
no more gentoo,
split out functions into .bash_extras
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Mon, 04 Jul 2022 18:14:41 +0100 |
parents | 2b59f3ef2294 |
children | b41425a5e2f6 |
rev | line source |
---|---|
0 | 1 # .bashrc |
2 | |
3 # Uncomment the following line if you don't like systemctl's auto-paging feature: | |
4 # export SYSTEMD_PAGER= | |
5 | |
157 | 6 # Source global definitions |
83
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
7 |
157 | 8 if [ -f /etc/bashrc ]; then |
9 # This is protected against running twice... | |
10 . /etc/bashrc | |
83
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
11 fi |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
12 |
157 | 13 . ~/.bash_extras |
0 | 14 |
157 | 15 savehist () |
16 { | |
17 hc=$(history 1 | tr -d '\n' | cut -d ' ' -f 2); | |
18 if [ $((hc % ${HIST_FREQ-10})) = 0 ]; then | |
19 history -a; | |
20 fi | |
0 | 21 } |
22 | |
157 | 23 prompt () |
0 | 24 { |
157 | 25 savehist |
26 echo -ne '\033]0;'${HOSTNAME/-login/} ${PWD/$HOME/\~}'\007' | |
0 | 27 } |
28 | |
157 | 29 if [ "$PS1" ]; then |
30 PS1='\[\033[1m\]\h\[\033[0m\]<\!>: ' | |
31 # LD_LIBRARY_PATH=/home/dc007/dc007/hst/lib64 gdb >/dev/null 2>&1 <<EOF | |
32 # attach $$ | |
33 # call (int) unbind_variable("tt") | |
34 # detach | |
35 # quit | |
36 # EOF | |
37 USER_PROMPT_COMMAND=prompt | |
38 echo "Vanilla bashrc" 1>&2 | |
39 # don't put duplicate lines or lines starting with space in the history. | |
40 # See bash(1) for more options | |
41 # export HISTCONTROL=ignoreboth | |
0 | 42 |
157 | 43 # append to the history file, don't overwrite it |
44 shopt -s histappend | |
83
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
45 |
157 | 46 # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) |
47 # export HISTSIZE=3000 | |
48 export HISTFILESIZE=6000 | |
49 export HISTIGNORE='[ ]*:&:[fb]g:exit' | |
50 fi | |
61 | 51 |
157 | 52 EDITOR=emacs |
53 | |
54 WSHARED=/work/dc007/dc007/shared | |
61 | 55 |
157 | 56 PATH=$PATH:$HOME/.local/bin:$HOME/bin:$WSHARED/bin |
57 | |
58 export PATH EDITOR PS1 WSHARED USER_PROMPT_COMMAND |