Created
November 14, 2013 08:41
-
-
Save ghprince/7463463 to your computer and use it in GitHub Desktop.
my .bashrc used for test code development in Solaris 10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function in_svn() { | |
if $(svn info >/dev/null 2>&1); then | |
return 0 | |
fi | |
return 1 | |
} | |
function get_svn_project_and_branch() { | |
svn info 2> /dev/null | \ | |
awk -F/ \ | |
'/^URL:/ { \ | |
for (i=0; i<=NF; i++) { \ | |
if ($i == "branches" || $i == "tags" ) { \ | |
printf "%s:%s", $(i-1), $(i+1); \ | |
break;\ | |
}; \ | |
if ($i == "trunk") { printf "%s:trunk", $(i-1); break; } \ | |
} \ | |
}' | |
} | |
function svn_prompt() { | |
if in_svn; then | |
echo "($(get_svn_project_and_branch))" | |
fi | |
} | |
export PATH=/export/home/tools:/usr/local/perl5/bin:/usr/local/tcl8.5.2.0/bin:/opt/csw/bin:/opt/sfw/bin:/usr/local/sbin/:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:/usr/sbin:/usr/bin:/usr/openwin/bin:/usr/ucb | |
export PS1="[\\u:\\W]\$(svn_prompt)$ " | |
alias vim='/usr/bin/env TERM=xterm-color vim' | |
alias vi='vim' | |
alias gv='gvim' | |
alias search='find -L . | xargs egrep' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment