Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 2
    Shouldn't that be either "$HOME/repository/foo" or "/home/$USER/repository/foo"? And the trailing slash may be a problem, at least my bash sets $PWD without it. Commented Jul 10, 2012 at 16:16
  • 1
    Also, this seems to be bash-specific. It doesn't work on my old ksh. Commented Jul 10, 2012 at 16:20
  • This isn't a good solution because it runs the command every time the prompt is displayed, not after a cd. Commented Jul 10, 2012 at 21:52
  • Yes, PROMT_COMMAND is bash-specific. The question contains the tags 'bash' so i assumed he was a bash user. The cd-function trick suggested by Arcege may be a better solution, note the possible security concern stated by jw013. Commented Jul 12, 2012 at 12:40
  • manatwork: true, I will update my answer. Commented Jul 12, 2012 at 12:41