bug-bash
[Top][All Lists]
Advanced

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

Re: bug when 'cd ..' to a directory who's parent has been deleted


From: Odd Beck
Subject: Re: bug when 'cd ..' to a directory who's parent has been deleted
Date: Tue, 9 Feb 2016 12:22:02 +0100

We all use our number crunching slaves differently, so I have never seen it until yesterday, but if it's common then there might be a valid reason to investigate this issue and maybe do some bugfixin' :)

On Tue, Feb 9, 2016 at 8:10 AM, Mike Frysinger <address@hidden> wrote:
On 08 Feb 2016 10:38, Chet Ramey wrote:
> On 2/8/16 10:36 AM, Andreas Schwab wrote:
> > Chet Ramey <address@hidden> writes:
> >> On 2/8/16 9:59 AM, Andreas Schwab wrote:
> >>> Chet Ramey <address@hidden> writes:
> >>>
> >>>> `cd ..' should fail, since the parent no longer exists, and the pathname
> >>>> canonicalization should fail, since there's presumably no longer a valid
> >>>> path to reach the current directory.  No value for $PWD is correct.
> >>>
> >>> ${PWD%/*} would be a reasonable value.  FWIW, this is what ksh uses in
> >>> this case, it doesn't fail.
> >>
> >> Why would that be more reasonable than anything else?  It references a
> >> path that doesn't exist.
> >
> > Sorry, I misread the OP's message.  I didn't notice it's about the
> > parent's parent, not the parent.
>
> It's still an unlikely scenario.

fwiw, i see it semi often when dealing with build systems:
- use a package manager to build a package
- PM creates a fresh new dir tree to build/install
- build fails for whatever reason
- go into that directory tree (usually multiple levels)
- figure out problem
- fix it in a diff window
- re-run the PM command to build the package in shell in build tree
- that shell's active tree is now gone and you get shell-init errors

just google "shell-init error retrieving current directory" to see
many other people randomly running into it as well.

i see it weekly, but i know what's going on, and i build a lot of
code.  so is it "unlikely" ?  i guess in the larger scheme of things
compared it might be, but i wouldn't say it's so unlikely that a user
would never see it.
-mike


reply via email to

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