Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_path {
- regex="\/([^\/]+)$"
- if [[ ${PWD} =~ $regex ]]; then
- n=${#BASH_REMATCH[*]}
- curpath=${BASH_REMATCH[1]}
- echo $curpath
- fi
- }
- export PROMPT_COMMAND='echo -ne "\033]0;$(get_path)\007"'
Add Comment
Please, Sign In to add comment