Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can directly create named directories with `hash -d`. Eg.

    hash -d dev=~/dev
    hash -d personal=~/dev/thorstenhans
    ...
Nothing else is needed.


I'd argue environmental variables have the strong advantage in that you can use them in cases that won't otherwise expand, namely programs that take a path parameter immediately following an equals, e.g.

    $ docker run --workdir=$dev foo
in these cases `--workdir=~dev` is not expanded and fails as docker does not understand your alias.


True and I often have both. I like my exported environment variables to be all caps and my directory aliases to be lowercase. This keeps their uses separate.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: