D&C Lug - Home Page
Devon & Cornwall Linux Users' Group

[ Date Index ][ Thread Index ]
[ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] remember current directory, change, cahnge back



Adrian Midgley wrote:
I want a shell script to leave the shell in the current directory after it finishes, but in between I want it to cd to a directory, execute this and that there, then cd back.

How do I get and then return the initial working directory?


Using BASH:



To store current directory pushd $PWD

To get back:
popd

--
Tom Salmon



--
The Mailing List for the Devon & Cornwall LUG
Mail majordomo@xxxxxxxxxxxx with "unsubscribe list" in the
message body to unsubscribe.


Lynx friendly