Mercurial > hg > cc > cirrus_home
annotate .bashrc @ 136:f30a1b268cea
more paths
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Wed, 21 Jul 2021 20:04:11 +0000 |
parents | 53006db54871 |
children | 2b59f3ef2294 |
rev | line source |
---|---|
0 | 1 # .bashrc |
2 | |
112 | 3 export G=${HOME}/gentoo |
0 | 4 # Uncomment the following line if you don't like systemctl's auto-paging feature: |
5 # export SYSTEMD_PAGER= | |
6 | |
83
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
7 if [ $SHELL = "/bin/bash" ] |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
8 then |
112 | 9 # Vanilla Cirrus login |
83
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
10 # Source global definitions |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
11 if [ -f /etc/bashrc ]; then |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
12 . /etc/bashrc |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
13 fi |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
14 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
15 if [ "$PS1" ]; then |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
16 PS1='\[\033[1m\]\h\[\033[0m\]<\!>: ' |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
17 echo "Vanilla bashrc" 1>&2 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
18 # don't put duplicate lines or lines starting with space in the history. |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
19 # See bash(1) for more options |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
20 # export HISTCONTROL=ignoreboth [readonly on Cirrus :-[ |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
21 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
22 # append to the history file, don't overwrite it |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
23 shopt -s histappend |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
24 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
25 # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
26 # export HISTSIZE=3000 [readonly on Cirrus :-[ |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
27 export HISTFILESIZE=6000 |
122 | 28 export HISTIGNORE='[ ]*:&:[fb]g:exit' |
83
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
29 fi |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
30 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
31 module load gcc # assumed by Prefix |
112 | 32 module load gnu-parallel |
83
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
33 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
34 export PYTHONPATH=$HOME/lib/python3.6/site-packages |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
35 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
36 PATH="/lustre/home/dc007/hst/lib/perl5/bin${PATH:+:${PATH}}"; export PATH; |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
37 PERL5LIB="/lustre/home/dc007/hst/lib/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB; |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
38 PERL_LOCAL_LIB_ROOT="/lustre/home/dc007/hst/lib/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT; |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
39 PERL_MB_OPT="--install_base \"/lustre/home/dc007/hst/lib/perl5\""; export PERL_MB_OPT; |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
40 PERL_MM_OPT="INSTALL_BASE=/lustre/home/dc007/hst/lib/perl5"; export PERL_MM_OPT; |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
41 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
42 export ANT_HOME=$HOME/src/apache-ant-1.10.7 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
43 export MAVEN_HOME=$HOME/src/apache-maven-3.6.3 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
44 export JAVA_HOME=$HOME/lib/openjdk-8u252-b09 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
45 export PATH=${PATH}:${ANT_HOME}/bin:${MAVEN_HOME}/bin |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
46 |
112 | 47 EDITOR=emacs |
83
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
48 else |
112 | 49 # gentoo |
83
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
50 if [ "$PS1" ]; then |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
51 echo "~/.bashrc inside gentoo" 1>&2 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
52 PS1='\[\e[1;32m\]\h\[\e[0m\]<\!>: ' |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
53 # Source some global definitions? |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
54 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
55 # These are readonly under Cirrus, so repeated here where they work1 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
56 export HISTCONTROL=ignoreboth |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
57 export HISTSIZE=3000 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
58 export HISTFILESIZE=6000 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
59 shopt -s histappend |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
60 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
61 if [ "$DISPLAY" ] |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
62 then |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
63 xrdb $HOME/.Xresources |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
64 fi |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
65 fi |
112 | 66 EDITOR=xemacs |
83
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
67 fi |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
68 |
0 | 69 # User specific aliases and functions |
83
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
70 #module add gnu-parallel |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
71 #export N1=rli4n35 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
72 #export N2=rli6n35 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
73 #export NN="$N1 $N2" |
0 | 74 |
75 # Tools | |
76 function lss() { | |
77 /bin/ls -l "$@" | sort -nr -k 5,5 | |
78 } | |
79 | |
80 function sus() { | |
81 sort "$@" | uniq -c | sort -k1nr,1 | |
82 } | |
83 | |
84 function tot () | |
85 { | |
86 awk '{sum+=$1} END {printf "%u\n",sum}' | |
87 } | |
88 | |
89 btot () | |
90 { | |
91 python3 -c 'import sys | |
92 n=0 | |
93 for l in sys.stdin: | |
126 | 94 try: |
95 n+=int(l) | |
96 except ValueError as e: | |
97 print(e,file=sys.stderr) | |
0 | 98 print(n) |
99 ' | |
100 } | |
101 | |
112 | 102 function uz () { $G/usr/bin/igzip -dc "$@" ; } |
83
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
103 |
0 | 104 function typecat () |
105 { | |
106 tt=$(type $1) | |
107 case $tt in | |
108 *\ is\ hashed\ *) cat $(echo $tt | cut -f 4 -d ' ' | tr -d '()') ;; | |
109 *\ is\ /*) cat $(echo $tt | cut -f 3 -d ' ' | tr -d '()') ;; | |
110 *) type $1 ;; | |
111 esac | |
112 } | |
83
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
113 #export HISTSIZE=3000 |
61 | 114 |
115 PATH=$PATH:$HOME/.local/bin:$HOME/bin | |
116 | |
112 | 117 export PATH EDITOR PS1 G |