bash dirtrim produces strange results with ~/foo/bar/var directory

Posted by queueoverflow on Ask Ubuntu See other posts from Ask Ubuntu or by queueoverflow
Published on 2011-06-20T17:27:25Z Indexed on 2011/06/21 0:30 UTC
Read the original article Hit count: 439

Filed under:
|

In some of my projects, I keep a var or a lib folder for runtime output and external libraries. To keep my prompt rather short, I have the export PROMPT_DIRTRIM=3 option in my .bashrc.

This works very well for most paths, but as soon as I have a /var in there, it goes nuts like this (for ~/Projects/someproject/var/gfx):

~/.../gfxr/gfxr/gfxr/gfxr/gfxr/gfx

Interestingly, it works with /opt/lampp/lib

Is there some way to get around this?


Update

© Ask Ubuntu or respective owner

Related posts about 11.04

Related posts about bash