Hacker News new | ask | show | jobs
by shared4you 4782 days ago
Path replacement is also possible in bash, as in:

    cd site1 site2
if you just add this line to your ~/.bashrc:

    function cd() { if [ $# -eq 2 ]; then builtin cd ${PWD/$1/$2}; else builtin cd $1; fi }
2 comments

that way all zsh functionality is "possible" if you write those functions.
There's no equivalent for the nifty tab completion where you can navigate around though. That's one of the few things I envy from zsh as a bash user.
A cleaner version:

^site1^site2

This will only work if cd is your last command, whereas the zsh version always works.