Guest User

Untitled

a guest
Jun 19th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. function get_path {
  2. regex="\/([^\/]+)$"
  3. if [[ ${PWD} =~ $regex ]]; then
  4. n=${#BASH_REMATCH[*]}
  5. curpath=${BASH_REMATCH[1]}
  6. echo $curpath
  7. fi
  8. }
  9.  
  10. export PROMPT_COMMAND='echo -ne "\033]0;$(get_path)\007"'
Add Comment
Please, Sign In to add comment