Hacker News new | ask | show | jobs
by fabjan 5592 days ago
Why not just

    shopt -s cdable_vars
    nm=`pwd`/blog
    cd nm
No need for hacks when you know how to shell.
1 comments

Annoying special cases:

    $ cd /
    $ nm=/foo
    $ ls | grep nm
    $ cd nm
    $ pwd
    /foo
    $ cd ~
    $ ls | grep nm
    nm
    $ cd nm
    $ pwd
    ~/nm
    $ echo FFFFFUUUUUUUUU
Inflexible:

    $ cd nm/jan/img
    cd: No such director nm/jan/img
    $ echo SHIT
    SHIT
    $ cd $nm/jan/img
Worse, It's nonstandard and only saves you one chracter.