-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
James B. Byrne wrote:
This is probably a FAQ item but despite searching extensively with google I am unable to find an answerer to this question. Perhaps I am using the wrong words. In any case, at the risk of inducing some mirth at my ignorance, how can one script a cd command so that that the user remains in that directory when the script exits?
pushd newdir # at the beginning of the script popd # before exiting
Alternately:
curdir=$(pwd) # at the beginning of the script cd $curdir # before exiting
For further information (and to find a list of the really useful features of the BASH shell) do: man bash
Barry