annotate .bashrc @ 84:c18c307cc325

merge, including pointless fix wrt pq
author Henry Thompson <ht@markup.co.uk>
date Mon, 21 Aug 2023 13:06:20 -0400
parents fd9bcd759606
children e1a05ead2b1c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
1 # .bashrc
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
2
bb5f1ea6cc5e getting started
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:
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
4 # export SYSTEMD_PAGER=
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
5
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
6 # Login for singularity
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
7 # Source global definitions
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
8
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
9 savehist ()
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
10 {
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
11 hc=$(history 1 | tr -d '\n' | cut -d ' ' -f 2);
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
12 if [ $((hc % ${HIST_FREQ-10})) = 0 ]; then
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
13 history -a;
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
14 fi
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
15 }
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
16
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
17 prompt ()
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
18 {
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
19 savehist
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
20 echo -ne '\033]0;'${HOSTNAME/-login/} ${PWD/$HOME/w\~}'\007'
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
21 }
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
22
72
fd9bcd759606 work with csing
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 9
diff changeset
23 PATH=$PATH:$HOME/.local/bin:$HOME/bin
fd9bcd759606 work with csing
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 9
diff changeset
24
0
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
25 if [ "$PS1" ]; then
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
26 echo "Singularity bash" 1>&2
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
27 # don't put duplicate lines or lines starting with space in the history.
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
28 # See bash(1) for more options
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
29 export HISTCONTROL=ignoreboth
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
30
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
31 # append to the history file, don't overwrite it
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
32 shopt -s histappend
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
33
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
34 # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
35 export HISTSIZE=3000
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
36 export HISTFILESIZE=6000
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
37 export HISTIGNORE='[ ]*:&:[fb]g:exit'
72
fd9bcd759606 work with csing
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 9
diff changeset
38
fd9bcd759606 work with csing
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 9
diff changeset
39 # fix $W -> \$W after tab completion
fd9bcd759606 work with csing
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 9
diff changeset
40 shopt -u progcomp
fd9bcd759606 work with csing
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 9
diff changeset
41
fd9bcd759606 work with csing
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 9
diff changeset
42 if [ -d /mnt/lustre/indy2lfs/sw/ ]
fd9bcd759606 work with csing
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 9
diff changeset
43 then
fd9bcd759606 work with csing
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 9
diff changeset
44 # We have access to mounted modules from Cirrus, use anaconda python libs,
fd9bcd759606 work with csing
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 9
diff changeset
45 # in particular, tkinter for matplotlib
fd9bcd759606 work with csing
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 9
diff changeset
46 export MODULES=/mnt/lustre/indy2lfs/sw
fd9bcd759606 work with csing
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 9
diff changeset
47 export SING=csing
fd9bcd759606 work with csing
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 9
diff changeset
48 export PYTHONPATH=:/usr/lib/python39.zip:/usr/lib/python3.9:/usr/lib/python3.9/lib-dynload:/usr/local/lib/python3.9/dist-packages:/usr/lib/python3/dist-packages
fd9bcd759606 work with csing
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 9
diff changeset
49 PATH=$MODULES/anaconda/anaconda3-2021.11/bin:$PATH
fd9bcd759606 work with csing
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 9
diff changeset
50 export XDG_RUNTIME_DIR=/tmp/runtime-$USER
fd9bcd759606 work with csing
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 9
diff changeset
51 fi
fd9bcd759606 work with csing
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 9
diff changeset
52
0
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
53 fi
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
54
9
05820245a047 work around problem with PROMPT_COMMAND
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 7
diff changeset
55 EDITOR=xemacs
0
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
56
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
57 PATH=$PATH:$HOME/.local/bin:$HOME/bin
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
58
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
59 HHOME=/home/dc007/dc007/$(whoami)
bb5f1ea6cc5e getting started
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
60
9
05820245a047 work around problem with PROMPT_COMMAND
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 7
diff changeset
61 export PATH EDITOR HHOME