@UncleAlbie @urusan
Great suggestion, also including pushd/popd!
The $1 could also be replaced with "$@" (including quotation marks), to avoid problems with parameters with spaces. See here for more information:
"What is the difference between $* and $@?"
https://unix.stackexchange.com/a/41595/264655