Mercurial > hg > cc > cirrus_home
annotate .bashrc @ 175:d123ef7fdb82
working on implementing types and parts:
1, 2, 4 working, 3 not
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Mon, 03 Jul 2023 18:16:14 +0100 |
parents | b41425a5e2f6 |
children | 4cb5cc893003 |
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 |
170 | 52 if [ -z "$TERMINFO" ] |
53 then | |
54 export TERMINFO=/usr/share/terminfo | |
55 # needed to allow tmux to work | |
56 fi | |
57 | |
157 | 58 EDITOR=emacs |
59 | |
60 WSHARED=/work/dc007/dc007/shared | |
170 | 61 W=/work/dc007/dc007/hst |
61 | 62 |
157 | 63 PATH=$PATH:$HOME/.local/bin:$HOME/bin:$WSHARED/bin |
64 | |
170 | 65 export PATH EDITOR PS1 WSHARED W USER_PROMPT_COMMAND |
66 export -f prompt savehist |