Grant Taylor wrote on Thu, 08 Apr 2021 01:06 +00:00: > pd () { > [ $# -eq 1 ] && pushd "${1}" > [ $# -eq 0 ] && popd > } This will return non-zero when pushd succeeds. setopt PRINT_EXIT_VALUE ☺