Re: Possible to add non-existing directory with pushd -n
From:
Wiley Young
Subject:
Re: Possible to add non-existing directory with pushd -n
Date:
Mon, 20 Jul 2026 08:15:15 -0700
>
> On 7/17/26 1:12 AM, Marcus Johansson via Bug reports for the GNU Bourne
> pushd -n dir
> >
> > This will add the directory 'dir' at position 1 in the stack even though
> it does not exist
On Fri, 17 Jul 2026 10:31:15 -0400, Chet Ramey wrote :
I guess it's in the eye of the beholder.
>
The `help` text for `pushd` reads:
"Add directories to stack. \n\n Adds a directory to the top of the
directory stack...."
The lack of a qualifier on the descriptor, "directory" and its repetition
in that form can lend itself to an interpretation of, if something is added
to the stack then it must be a directory, when in reality that's not
necessarily the case.
Qualifying it as a "directory path" could signal that that there's some
variation in how `pushd` can handle both hypothetical and real files:
"Add directory paths to stack. \n\n Adds a directory path to the top of
the directory stack...."
Wiley