Article Listing 1 Listing 2 Listing 3 Listing 4 dec2005.tar

Listing 2 Bill Rosenblatt's popd

#!/bin/ksh

if [[ -n $DIRSTACK ]]; then
    DIRSTACK=${DIRSTACK#* }
    cd ${DIRSTACK%% *}
    print "$PWD"
else
    print "stack empty, still in $PWD."
fi
# end listing 2