Mercurial > hg > cc > cirrus_home
annotate .bashrc @ 93:4d870a7ec871
support a command to receive each result,
remove use of X-Crawler-Content-Length
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Thu, 15 Apr 2021 10:59:25 +0000 |
parents | 8fb11e337e23 |
children | bcea0410143c |
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 | |
83
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
6 if [ $SHELL = "/bin/bash" ] |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
7 then |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
8 # Source global definitions |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
9 if [ -f /etc/bashrc ]; then |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
10 . /etc/bashrc |
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 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
13 if [ "$PS1" ]; then |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
14 PS1='\[\033[1m\]\h\[\033[0m\]<\!>: ' |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
15 echo "Vanilla bashrc" 1>&2 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
16 # 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
|
17 # See bash(1) for more options |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
18 # export HISTCONTROL=ignoreboth [readonly on Cirrus :-[ |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
19 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
20 # append to the history file, don't overwrite it |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
21 shopt -s histappend |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
22 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
23 # 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
|
24 # export HISTSIZE=3000 [readonly on Cirrus :-[ |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
25 export HISTFILESIZE=6000 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
26 fi |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
27 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
28 module load gcc # assumed by Prefix |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
29 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
30 export PYTHONPATH=$HOME/lib/python3.6/site-packages |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
31 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
32 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
|
33 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
|
34 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
|
35 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
|
36 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
|
37 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
38 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
|
39 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
|
40 export JAVA_HOME=$HOME/lib/openjdk-8u252-b09 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
41 export PATH=${PATH}:${ANT_HOME}/bin:${MAVEN_HOME}/bin |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
42 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
43 else |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
44 if [ "$PS1" ]; then |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
45 echo "~/.bashrc inside gentoo" 1>&2 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
46 PS1='\[\e[1;32m\]\h\[\e[0m\]<\!>: ' |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
47 # Source some global definitions? |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
48 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
49 # 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
|
50 export HISTCONTROL=ignoreboth |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
51 export HISTSIZE=3000 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
52 export HISTFILESIZE=6000 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
53 shopt -s histappend |
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 if [ "$DISPLAY" ] |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
56 then |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
57 xrdb $HOME/.Xresources |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
58 fi |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
59 fi |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
60 fi |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
61 |
0 | 62 # User specific aliases and functions |
83
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
63 #module add gnu-parallel |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
64 #export N1=rli4n35 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
65 #export N2=rli6n35 |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
66 #export NN="$N1 $N2" |
0 | 67 |
68 # Tools | |
69 function lss() { | |
70 /bin/ls -l "$@" | sort -nr -k 5,5 | |
71 } | |
72 | |
73 function sus() { | |
74 sort "$@" | uniq -c | sort -k1nr,1 | |
75 } | |
76 | |
77 function tot () | |
78 { | |
79 awk '{sum+=$1} END {printf "%u\n",sum}' | |
80 } | |
81 | |
82 btot () | |
83 { | |
84 python3 -c 'import sys | |
85 n=0 | |
86 for l in sys.stdin: | |
87 n+=int(l) | |
88 print(n) | |
89 ' | |
90 } | |
91 | |
83
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
92 function uz () { unpigz -dp 1 -c "$@" ; } |
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
93 |
0 | 94 function typecat () |
95 { | |
96 tt=$(type $1) | |
97 case $tt in | |
98 *\ is\ hashed\ *) cat $(echo $tt | cut -f 4 -d ' ' | tr -d '()') ;; | |
99 *\ is\ /*) cat $(echo $tt | cut -f 3 -d ' ' | tr -d '()') ;; | |
100 *) type $1 ;; | |
101 esac | |
102 } | |
83
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
103 #export HISTSIZE=3000 |
61 | 104 |
105 PATH=$PATH:$HOME/.local/bin:$HOME/bin | |
106 EDITOR=emacs | |
107 | |
83
8fb11e337e23
environment improvements
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
61
diff
changeset
|
108 export PATH EDITOR PS1 |