6 comments

[ 2.3 ms ] story [ 25.8 ms ] thread
Excellent idea! I especially like the idea of using the `chpwd()` hook to display the current tasks when entering a new directory. I must steal this idea and Bashify it.
I like seeing a listing when I cd.

    cd() { builtin cd $* && ls; }
I cannot recall if that is right (on my phone) but that's the idea in bash at least.
I just tried it; it works.

Very nice; thanks

Always use "$@" (including the quotes) instead of $* when passing on command-line arguments.

If your directory name contains a space, the above function won’t work. Note that putting $* in quotes would be interpreted as one argument, so that wouldn’t work if you specified an option along with a directory name.

Yeah that's what I use but couldn't remember it off the top of my head. Thanks.
Haha this was the first thing I prototyped into my bashrc to incorporate the idea. I used the suggested "$@" myself.