SPath

'short path'

Use shortcuts when 'cd'ing on the command line. (this probably already exists)

Written in Ruby.

Installation

Install it as:

$ gem install spath

Add this to your .bashrc (suggested):

alias s='spath create'
alias l='spath list'    
function c(){cd $(spath path $*||echo .)}

( c is required to be defined as a function because a Ruby script can not change the working directory of its parent process. )

To do:

Add configuration options. Add tests. Add better error handling.

Usage

Create shortcuts for common places with the command 'spath create [nick] [path]'

$ spath create ltr /home/you/docs/letters

Non-absolute paths are acceptable.

$ cd /home/you/public/long/path/skynet/releases/v01-02-03/doc/
$ spath create snet ../

Visit them with the shortcut you made with the function 'c [nick]'.

you@computer $ c snet
you@computer $ pwd
/home/you/public/long/path/skynet/releases/v01-02-03/

List all available shortcuts with the command 'spath list'.

you@computer ~ $ spath list
 snetdoc => /home/you/public/long/path/skynet/releases/v01-02-03/
     ltr => /home/you/docs/letters
      mu => /home/you

Shortcuts are stored at ~/.spath in YAML format.