bash,zsh: improved d()