[plug] pushd and popd

Dean Bergin dean.bergin at gmail.com
Thu Jan 20 16:14:40 AWST 2022

I always thought that popd and pushd is useful in scripts to do what you
need to do within your script and easily return to the original working
directory of the user without them even knowing that directory changes
occured or knowing what directory they where in before the script was

One thing that annoys me greatly is when scripts mess with my pwd or
$OLDPWD because the developer was too lazy to keep track of the pwd before
execution or leveraging pushd and popd.

On Thu, 20 Jan 2022, 13:41 Gregory Orange, <home at oranges.id.au> wrote:

> On 20/1/22 1:06 pm, Juneidy wrote:
> > I wonder if anyone here used `pushd` and `popd` frequently? What sort of
> > navigation would you use that for?
> >
> > The best example someone in office told me is if you are following
> > source code's function call and does not have terminal multiplexer like
> > GNU screen, `pushd` is good if you want to check other source code
> > containing the function definition and you can navigate back to the
> > calling source code directory just by calling `popd`.
> That's exactly the sort of follow-the-bouncing-ball tactic I have used a
> few times here and there, but I can't quite seem to form a habit out of
> it. I'm a rare screen/tmux user too.
> I tend to like seeing one and the other and being able to jump between
> them or see them together though. So, I end up with lots of tabs in my
> terminals, and separate terminals when I want to show them on screen
> together.
> Greg.
> _______________________________________________
> PLUG discussion list: plug at plug.org.au
> http://lists.plug.org.au/mailman/listinfo/plug
> Committee e-mail: committee at plug.org.au
> PLUG Membership: http://www.plug.org.au/membership
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plug.org.au/pipermail/plug/attachments/20220120/09572c16/attachment.html>

More information about the plug mailing list