pathabbr-0.3.tar.bz2 (12.3 kB)
Pathabbr abbreviates paths to given length using ellipsis.
Pathabbr is primarily intended for shortening bash prompt. It's however quite general and everything, including the string used as ellipsis and the set of rules defining good places to break the path at, can be customized. Thus it can be used to abbreviate other path types than file/directory names.
Some simple examples:
$ cd /usr/X11R6/lib/X11/xkb/geometry/sgi $ pwd | pathabbr 20 /usr/../geometry/sgi $ pwd | pathabbr 30 /usr..lib/X11/xkb/geometry/sgi $ pwd | pathabbr -r 0 30 /usr/X11R6/lib/../geometry/sgi $ pwd | pathabbr -r 2.0 30 ..1R6/lib/X11/xkb/geometry/sgi $ pwd | pathabbr -e ">>>" 30 /usr/X11R6>>>/xkb/geometry/sgi
Copyright © 2002 Yeti (David Necas) <yeti at physics dot muni dot cz>.
Copyright © 2005 Rizwan Kassim <rizwank at geekymedia dot com>.
Pathabbr is free software; you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version. For full license text see file COPYING
included in the source tarball.