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

2016-02-08 Thread Mike Frysinger
On 08 Feb 2016 10:38, Chet Ramey wrote: > On 2/8/16 10:36 AM, Andreas Schwab wrote: > > Chet Ramey writes: > >> On 2/8/16 9:59 AM, Andreas Schwab wrote: > >>> Chet Ramey writes: > >>> > `cd ..' should fail, since the parent no longer exists, and the pathname > canonicalization should fa

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

2016-02-08 Thread Odd Beck
And I now understand the initial confusion as I attached the wrong picture in the first email. The picture I was supposed to send included both terminal windows which would (most likely) have explained the situation better than just that one terminal :-S On Tue, Feb 9, 2016 at 7:16 AM, Odd Beck

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

2016-02-08 Thread Odd Beck
Well, in all fareness, this is highly unlikely that it would happen, but it did happen to me while I was cleanup up some rubbish in my filesystem. It wasn't a big deal as I quickly realized what was happening. Here's the way I reproduced it: Terminal1: mkdi

Bogus value of variable BASH

2016-02-08 Thread David Hunt
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE

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

2016-02-08 Thread Linda Walsh
Dave Rutherford wrote: On Mon, Feb 8, 2016 at 11:34 AM, Linda Walsh > wrote: >> Why would that be more reasonable than anything else? It references a >> path that doesn't exist. > Um...Not exactly. As long as there's a handle open to the previous path, > it still exi

Re: manpage question re: '--debugger': what/where is debugger *profile*

2016-02-08 Thread Chet Ramey
On 2/8/16 4:06 PM, Linda Walsh wrote: > Under the bash-arg "--debugger" it says: > >Arrange for the debugger profile to be executed before the shell >starts. Turns on extended debugging mode (see the description >of the extdebug option to the shopt builtin below). > > > When I

manpage question re: '--debugger': what/where is debugger *profile*

2016-02-08 Thread Linda Walsh
Under the bash-arg "--debugger" it says: Arrange for the debugger profile to be executed before the shell starts. Turns on extended debugging mode (see the description of the extdebug option to the shopt builtin below). When I think of a "profile" in bash, I think of things like

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

2016-02-08 Thread Chet Ramey
On 2/8/16 11:34 AM, Linda Walsh wrote: >> Why would that be more reasonable than anything else? It references a >> path that doesn't exist. >> >> > Um...Not exactly. As long as there's a handle open to the previous path, > it still exists (at least on linux and unix). The actual filesystem o

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

2016-02-08 Thread Chet Ramey
On 2/8/16 10:57 AM, Andreas Schwab wrote: > Chet Ramey writes: > >> If you assume, as the OP said, that only the parent is removed, it's >> unlikely. > > You cannot remove a non-empty directory, so this does not make sense. And so we return to the first paragraph of my original response. -- `

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

2016-02-08 Thread Dave Rutherford
On Mon, Feb 8, 2016 at 11:34 AM, Linda Walsh wrote: > Chet Ramey wrote: >> On 2/8/16 9:59 AM, Andreas Schwab wrote: >>> Chet Ramey writes: `cd ..' should fail, since the parent no longer exists, and the pathname canonicalization should fail, since there's presumably no longer a valid >>

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

2016-02-08 Thread Andreas Schwab
Linda Walsh writes: > Um...Not exactly. As long as there's a handle open to the previous path, > it still exists (at least on linux and unix). You cannot have handles on file names, only on files. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970

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

2016-02-08 Thread Linda Walsh
Chet Ramey wrote: On 2/8/16 9:59 AM, Andreas Schwab wrote: Chet Ramey 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

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

2016-02-08 Thread Andreas Schwab
Chet Ramey writes: > If you assume, as the OP said, that only the parent is removed, it's > unlikely. You cannot remove a non-empty directory, so this does not make sense. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA

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

2016-02-08 Thread Andreas Schwab
Chet Ramey writes: > On 2/8/16 9:59 AM, Andreas Schwab wrote: >> Chet Ramey 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

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

2016-02-08 Thread Chet Ramey
On 2/8/16 10:49 AM, Andreas Schwab wrote: > Chet Ramey writes: > >> It's still an unlikely scenario. > > What do you mean with unlikely? Removing some directory where there is > still a shell active can happen all the time. Removing a non-empty directory is unlikely to happen. If you assume,

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

2016-02-08 Thread Andreas Schwab
Chet Ramey writes: > It's still an unlikely scenario. What do you mean with unlikely? Removing some directory where there is still a shell active can happen all the time. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA

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

2016-02-08 Thread Chet Ramey
On 2/8/16 10:36 AM, Andreas Schwab wrote: > Chet Ramey writes: > >> On 2/8/16 9:59 AM, Andreas Schwab wrote: >>> Chet Ramey writes: >>> `cd ..' should fail, since the parent no longer exists, and the pathname canonicalization should fail, since there's presumably no longer a valid

Re: capturing in ${VAR//(*(\/)(+([^\/]))?(\/)/_${BASH_REMATCH[1]}_}

2016-02-08 Thread Stephane Chazelas
2016-02-08 09:00:09 -0500, Chet Ramey: > On 2/8/16 2:47 AM, Linda Walsh wrote: > > When you are doing a var expansion using the > > replacement format ${VAR//./.}, is there some way to > > put parens around some part of the expression and reference > > them as in the [[V~re]] RE-matches? > > No.

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

2016-02-08 Thread Greg Wooledge
On Mon, Feb 08, 2016 at 10:09:29AM -0500, Chet Ramey wrote: > On 2/8/16 9:59 AM, Andreas Schwab wrote: > > Chet Ramey 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 t

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

2016-02-08 Thread Chet Ramey
On 2/8/16 9:59 AM, Andreas Schwab wrote: > Chet Ramey 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

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

2016-02-08 Thread Andreas Schwab
Chet Ramey 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 wha

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

2016-02-08 Thread Chet Ramey
On 2/8/16 7:09 AM, Odd Beck wrote: > Hi! > > When I'm in a folder, and then remove that folder's parent from a different > shell, and I then press 'cd ..', I get an error, and then a weird result in > the path that shows my current directory. It's not clear what you expect to happen. I'm not sur

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

2016-02-08 Thread Odd Beck
Hi! When I'm in a folder, and then remove that folder's parent from a different shell, and I then press 'cd ..', I get an error, and then a weird result in the path that shows my current directory. Here's a picture where you can see the weird result. Best regards Odd Beck

Re: capturing in ${VAR//(*(\/)(+([^\/]))?(\/)/_${BASH_REMATCH[1]}_}

2016-02-08 Thread Chet Ramey
On 2/8/16 2:47 AM, Linda Walsh wrote: > When you are doing a var expansion using the > replacement format ${VAR//./.}, is there some way to > put parens around some part of the expression and reference > them as in the [[V~re]] RE-matches? No. Shell patterns do not have backreferences. -- ``Th