You can use the pushd and popd commands in bash - or if you don't likebash, write your own equivalent functions in plain old bourne shell.