help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: about the “OLDOLDPWD”


From: Dennis Williamson
Subject: Re: about the “OLDOLDPWD”
Date: Thu, 16 Jun 2022 11:27:20 -0500

On Thu, Jun 16, 2022, 10:37 AM Greg Wooledge <greg@wooledge.org> wrote:

> On Thu, Jun 16, 2022 at 01:29:01PM +0800, lumianshuo@DELL via wrote:
> > Hello , when I use the cd and dirs. Sometimes I need the last‘OLDPWD is
> cur PWD or not .
> > Alright I can record the var at the begin. But if can I judge this by a
> tool that shell given? i.e. have the shell save the “last” OLDPWD ? If have
> , where have it saved?
>
> Have a look at pushd and popd.  Otherwise, there's always saving $PWD
> into another variable, as you already said.
>


In addition to pushd and popd, look at the dirs command and the DIRSTACK
array.

>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]