News for hackers. Stuff that matters.
Re:Shell Script Best Practices, from a decade of scripting t... by rascul on Thursday October 27, 2022 @08:25AM (#33356489)
> - It may be useful to copy `$PWD` into a variable before changing directory

$OLDPWD is set when you 'cd'. Also 'cd -' will take you back to the last directory.

https://pubs.opengroup.org/onlinepubs/9699919799/

There are no comments on this comment yet.