export PS1='$USER@${HOSTNAME%%.*}:$PWD ' alias cls=clear alias dir='ls -lrt' alias md='mkdir -p' alias o='p4 opened ...' export PATH=~/bin:$PATH:. export P4CONFIG=.p4config # Enable 'vi' command line editing mode. set -o vi #------------------------------------------------------------------------------ # Perforce Login using local .p4passwd files, which should have # 600 perms and only be used on computers which are well secured. #------------------------------------------------------------------------------ function p4li () { declare Dir=$PWD declare -i SlashCount=$(echo $PWD | tr -d -c '/' | wc -m) declare -i i=0 declare -i Found=0 while [[ $i -le $SlashCount ]]; do if [[ -r $Dir/.p4passwd ]]; then p4 login -a < $Dir/.p4passwd Found=1 break fi Dir=${Dir%/*} i+=1 done [[ $Found -eq 1 ]] || echo -e "\nNo .p4passwd file found between / and $PWD." } # Source additional resources in a 'local' file not versioned # centrally (or at all). [[ -r ~/.bashrc.local ]] && source ~/.bashrc.local # History File Management [[ -d ~/.hist ]] || mkdir ~/.hist export HISTFILE=~/.hist/history.$$.$RANDOM