annotate .bashrc @ 208:cbe631c26d53 default tip

both now working
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Thu, 11 Jun 2026 21:20:22 +0100
parents b4486b5df065
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
65a56c0d1c1f bolting the barn door...
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
1 # .bashrc
65a56c0d1c1f bolting the barn door...
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
2
65a56c0d1c1f bolting the barn door...
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
3 # Uncomment the following line if you don't like systemctl's auto-paging feature:
65a56c0d1c1f bolting the barn door...
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
4 # export SYSTEMD_PAGER=
65a56c0d1c1f bolting the barn door...
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
5
157
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
6 # Source global definitions
83
8fb11e337e23 environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 61
diff changeset
7
157
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
8 if [ -f /etc/bashrc ]; then
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
9 # This is protected against running twice...
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
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
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
13 . ~/.bash_extras
0
65a56c0d1c1f bolting the barn door...
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
14
157
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
15 savehist ()
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
16 {
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
17 hc=$(history 1 | tr -d '\n' | cut -d ' ' -f 2);
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
18 if [ $((hc % ${HIST_FREQ-10})) = 0 ]; then
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
19 history -a;
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
20 fi
0
65a56c0d1c1f bolting the barn door...
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
21 }
65a56c0d1c1f bolting the barn door...
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
22
157
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
23 prompt ()
0
65a56c0d1c1f bolting the barn door...
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
24 {
157
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
25 savehist
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
26 echo -ne '\033]0;'${HOSTNAME/-login/} ${PWD/$HOME/\~}'\007'
0
65a56c0d1c1f bolting the barn door...
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
27 }
65a56c0d1c1f bolting the barn door...
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
28
207
b4486b5df065 move common stuff to share/.bash_extras
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 200
diff changeset
29 alias ls="ls -F --color=auto"
b4486b5df065 move common stuff to share/.bash_extras
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 200
diff changeset
30
157
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
31 if [ "$PS1" ]; then
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
32 PS1='\[\033[1m\]\h\[\033[0m\]<\!>: '
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
33 # LD_LIBRARY_PATH=/home/dc007/dc007/hst/lib64 gdb >/dev/null 2>&1 <<EOF
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
34 # attach $$
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
35 # call (int) unbind_variable("tt")
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
36 # detach
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
37 # quit
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
38 # EOF
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
39 USER_PROMPT_COMMAND=prompt
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
40 echo "Vanilla bashrc" 1>&2
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
41 # don't put duplicate lines or lines starting with space in the history.
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
42 # See bash(1) for more options
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
43 # export HISTCONTROL=ignoreboth
0
65a56c0d1c1f bolting the barn door...
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
44
157
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
45 # append to the history file, don't overwrite it
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
46 shopt -s histappend
83
8fb11e337e23 environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 61
diff changeset
47
157
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
48 # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
49 # export HISTSIZE=3000
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
50 export HISTFILESIZE=6000
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
51 export HISTIGNORE='[ ]*:&:[fb]g:exit'
182
dfb88dee52b8 tab completion fix
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 180
diff changeset
52
dfb88dee52b8 tab completion fix
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 180
diff changeset
53 # fix $W -> \$W after tab completion
dfb88dee52b8 tab completion fix
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 180
diff changeset
54 shopt -u progcomp
dfb88dee52b8 tab completion fix
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 180
diff changeset
55
157
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
56 fi
61
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 20
diff changeset
57
170
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 157
diff changeset
58 if [ -z "$TERMINFO" ]
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 157
diff changeset
59 then
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 157
diff changeset
60 export TERMINFO=/usr/share/terminfo
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 157
diff changeset
61 # needed to allow tmux to work
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 157
diff changeset
62 fi
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 157
diff changeset
63
157
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
64 EDITOR=emacs
cac9586291ad no more gentoo,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 153
diff changeset
65
207
b4486b5df065 move common stuff to share/.bash_extras
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 200
diff changeset
66 export PS1 USER_PROMPT_COMMAND
170
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 157
diff changeset
67 export -f prompt savehist
180
4cb5cc893003 add private work bin dir to PATH
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 170
diff changeset
68 module load tmux