view .bashrc @ 137:bb0153be65b5

add cl arg --fpath replacing FPAT, which is now default value
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Wed, 21 Jul 2021 20:05:42 +0000
parents 53006db54871
children 2b59f3ef2294
line wrap: on
line source

# .bashrc

export G=${HOME}/gentoo
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=

if [ $SHELL = "/bin/bash" ]
then
    # Vanilla Cirrus login
    # Source global definitions
    if [ -f /etc/bashrc ]; then
	    . /etc/bashrc
    fi

    if [ "$PS1" ]; then
      PS1='\[\033[1m\]\h\[\033[0m\]<\!>: '
      echo "Vanilla bashrc" 1>&2
      # don't put duplicate lines or lines starting with space in the history.
      # See bash(1) for more options
      # export HISTCONTROL=ignoreboth [readonly on Cirrus :-[

      # append to the history file, don't overwrite it
      shopt -s histappend

      # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
      # export HISTSIZE=3000 [readonly on Cirrus :-[
      export HISTFILESIZE=6000
      export HISTIGNORE='[ ]*:&:[fb]g:exit'
    fi
    
    module load gcc # assumed by Prefix
    module load gnu-parallel

    export PYTHONPATH=$HOME/lib/python3.6/site-packages

    PATH="/lustre/home/dc007/hst/lib/perl5/bin${PATH:+:${PATH}}"; export PATH;
    PERL5LIB="/lustre/home/dc007/hst/lib/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
    PERL_LOCAL_LIB_ROOT="/lustre/home/dc007/hst/lib/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
    PERL_MB_OPT="--install_base \"/lustre/home/dc007/hst/lib/perl5\""; export PERL_MB_OPT;
    PERL_MM_OPT="INSTALL_BASE=/lustre/home/dc007/hst/lib/perl5"; export PERL_MM_OPT;

    export ANT_HOME=$HOME/src/apache-ant-1.10.7
    export MAVEN_HOME=$HOME/src/apache-maven-3.6.3
    export JAVA_HOME=$HOME/lib/openjdk-8u252-b09
    export PATH=${PATH}:${ANT_HOME}/bin:${MAVEN_HOME}/bin

    EDITOR=emacs
else
    # gentoo
    if [ "$PS1" ]; then
       echo "~/.bashrc inside gentoo" 1>&2
       PS1='\[\e[1;32m\]\h\[\e[0m\]<\!>: '
       # Source some global definitions?

       # These are readonly under Cirrus, so repeated here where they work1
       export HISTCONTROL=ignoreboth
       export HISTSIZE=3000
       export HISTFILESIZE=6000
       shopt -s histappend

       if [ "$DISPLAY" ]
       then
	xrdb $HOME/.Xresources
       fi
   fi
   EDITOR=xemacs
fi

# User specific aliases and functions
#module add gnu-parallel
#export N1=rli4n35
#export N2=rli6n35
#export NN="$N1 $N2"

# Tools
function lss() {
  /bin/ls -l "$@" | sort -nr -k 5,5
  }

function sus() {
  sort "$@" | uniq -c | sort -k1nr,1
}

function tot ()
{
    awk '{sum+=$1} END {printf "%u\n",sum}'
}

btot ()
{
    python3 -c 'import sys
n=0
for l in sys.stdin:
 try:
  n+=int(l)
 except ValueError as e:
  print(e,file=sys.stderr)
print(n)
'
}

function uz () { $G/usr/bin/igzip -dc "$@" ; }

function typecat ()
{
  tt=$(type $1)
  case $tt in
   *\ is\ hashed\ *) cat $(echo $tt | cut -f 4 -d ' ' | tr -d '()') ;;
   *\ is\ /*) cat $(echo $tt | cut -f 3 -d ' ' | tr -d '()') ;;
   *) type $1 ;;
  esac
}
#export HISTSIZE=3000

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH EDITOR PS1 G