Link to home
Start Free TrialLog in
Avatar of perlperl
perlperl

asked on

changing and restore working directory in bash

curr_dir=`pwd`
cd $dir
##
##  Do some processing
##
cd $curr_dir


Is this inefficient way of restoring directory in bash script or is there some other standard way?
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of perlperl
perlperl

ASKER

Interesting i will try cd$OLDPWD and cd -  both

Thanks
Thanks,
cd - worked. no need to save unnecessary working dir first