Skip to content

Instantly share code, notes, and snippets.

@ghprince
Created November 14, 2013 08:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghprince/7463463 to your computer and use it in GitHub Desktop.
Save ghprince/7463463 to your computer and use it in GitHub Desktop.
my .bashrc used for test code development in Solaris 10
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