Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- is_solaris()
- {
- uname -a | grep SunOS >/dev/null
- }
- export -f is_solaris
- ps1() {
- local l_ps1='';
- local ID_PRG=id
- is_solaris && ID_PRG=/usr/xpg4/bin/id
- hname=$(hostname -s)
- l_ps1="[$($ID_PRG -u -n)@$hname "
- current_directory=$(basename "$PWD")
- l_ps1="${l_ps1}${current_directory}"
- git status 2>/dev/null 1>/dev/null && \
- branch=$(git status | grep "On branch" | sed -e 's/On branch \([a-zA-Z0-9]*\)/\1/g') && \
- l_ps1="$l_ps1 (${branch})"
- l_ps1="$l_ps1]$ "
- echo $l_ps1
- }
- export -f ps1
- export PAGER=less
- export EDITOR=vim
- export PS1='$(ps1) '
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement