phaniarnab commented on pull request #1325: URL: https://github.com/apache/systemds/pull/1325#issuecomment-869048610
> Should we use `cd`? > > The `pushd` and `popd` may work like, which is a built-in function. > > ```shell > pushd () > { > dirname=$1 > DIR_STACK="$dirname ${DIR_STACK:-$PWD' '}" > cd ${dirname:?"missing directory name."} > echo "$DIR_STACK" > } > > popd () > { > DIR_STACK=${DIR_STACK#* } > cd ${DIR_STACK%% *} > echo "$PWD" > } > ``` > > source: https://www.oreilly.com/library/view/learning-the-bash/1565923472/ch04s05.html > > Does this spawn a subshell? Yes. Directory stack makes sense when working with multiple directories. For our use case, you can save the `pwd` in a local variable, use `cd` to enter your target folder, and later apply something like `cd $pwd` to get back to your original location if needed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@systemds.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org