export PS1='$USER@${HOSTNAME%%.%}:$PWD '
set -o vi
alias cls=clear
alias md='mkdir -p'
alias rd=rmdir
alias o='p4 opened ...'
alias s4='ssh -l svgp4 helix-in4'
[[ -d ~/bin ]] && export PATH=~/bin:$PATH
#------------------------------------------------------------------------------
# Find a .p4passwd in your dir and login to Perforce.
#------------------------------------------------------------------------------
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."
}