view .bashrc @ 170:b41425a5e2f6

add $W
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Wed, 20 Jul 2022 19:48:11 +0100
parents cac9586291ad
children 4cb5cc893003
line wrap: on
line source

# .bashrc

# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=

# Source global definitions

if [ -f /etc/bashrc ]; then
  # This is protected against running twice...
  . /etc/bashrc
fi

. ~/.bash_extras

savehist () 
{ 
    hc=$(history 1 | tr -d '\n' | cut -d ' ' -f 2);
    if [ $((hc % ${HIST_FREQ-10})) = 0 ]; then
        history -a;
    fi
}

prompt ()
{
    savehist
    echo -ne '\033]0;'${HOSTNAME/-login/} ${PWD/$HOME/\~}'\007'
}

if [ "$PS1" ]; then
  PS1='\[\033[1m\]\h\[\033[0m\]<\!>: '
#   LD_LIBRARY_PATH=/home/dc007/dc007/hst/lib64 gdb >/dev/null 2>&1 <<EOF
#  attach $$                       
#  call (int) unbind_variable("tt")
# detach
# quit
# EOF
  USER_PROMPT_COMMAND=prompt
  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

  # 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
  export HISTFILESIZE=6000
  export HISTIGNORE='[ ]*:&:[fb]g:exit'
fi

if [ -z "$TERMINFO" ]
then
 export TERMINFO=/usr/share/terminfo
 # needed to allow tmux to work
fi

EDITOR=emacs

WSHARED=/work/dc007/dc007/shared
W=/work/dc007/dc007/hst

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

export PATH EDITOR PS1 WSHARED W USER_PROMPT_COMMAND
export -f prompt savehist