Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. export PS1='$( readlink -f . )'
  2.  
  3. $ export PS1='$( readlink -f . ) $ '
  4. /home/danielbeck $ ln -s /etc foo
  5. /home/danielbeck $ cd foo
  6. /etc $ _
  7.  
  8. /etc $ cd ..
  9. /home/danielbeck $ _
  10.  
  11. function cd {
  12. if [[ $# -ne 1 ]] ; then
  13. builtin cd "$@"
  14. elif [[ "$1" = "-" ]] ; then
  15. builtin cd -
  16. else
  17. builtin cd "$( readlink -f "$1" )"
  18. fi
  19. }
  20.  
  21. function cd {
  22. builtin cd "$@"
  23. builtin cd "$( readlink -f . )"
  24. }
  25.  
  26. if [ "$color_prompt" = yes ]; then
  27. PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]$(readlink -f w)[33[00m]$ ' else
  28. PS1='${debian_chroot:+($debian_chroot)}u@h:$(readlink -f w)$ ' fi
  29. unset color_prompt force_color_prompt
  30.  
  31. # If this is an xterm set the title to user@host:dir
  32. case "$TERM" in
  33. xterm*|rxvt*)
  34. PS1="[e]0;${debian_chroot:+($debian_chroot)}u@h: $(readlink -f .)a]$PS1"
  35. ;;
  36. *)
  37. ;;
  38. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement