ksh(1)'sIsn't there a "poor man's" push/popd using cd(1) that toggles between the last two directories?
cd -
does that.sh(1) and tcsh(1) do too.ksh(1)'scd -
does that.
# cd /tmp/
# pwd
/tmp
# cd test/
# pwd
/tmp/test
# cd -
/tmp
#
root@molly:~ # cd /tmp/
root@molly:/tmp # cd test/
root@molly:/tmp/test # cd -
root@molly:/tmp #
pwd
to your own variable to keep track of directories.