Documentation issue

2017-10-26 Thread Eli Barzilay
Bash surprised me with the behavior mentioned here: https://stackoverflow.com/questions/15897473 This can be pretty bad in that it's very unexpected (see the comments). Also, the surprise can be triggered without nullglob as well: $ foo=(a b c) $ touch foo0 $ unset foo[0] $ e

Re: Documentation issue

2017-10-26 Thread Pierre Gaston
On Thu, Oct 26, 2017 at 8:18 AM, Eli Barzilay wrote: > Bash surprised me with the behavior mentioned here: > > https://stackoverflow.com/questions/15897473 > > This can be pretty bad in that it's very unexpected (see the comments). > Also, the surprise can be triggered without nullglob as wel

Re: Documentation issue

2017-10-26 Thread Chet Ramey
On 10/26/17 1:18 AM, Eli Barzilay wrote: > Bash surprised me with the behavior mentioned here: > > https://stackoverflow.com/questions/15897473 > > This can be pretty bad in that it's very unexpected (see the comments). I'm not sure why this is a surprise. Pathname expansion (globbing) is on

Re: ctrl-w oddity on bash-4.4

2017-10-26 Thread Chet Ramey
On 10/26/17 12:21 AM, Robert Elz wrote: > Date:Wed, 25 Oct 2017 10:45:11 -0400 > From:Chet Ramey > Message-ID: <6751ad10-cccb-0467-a751-c5be8e745...@case.edu> > > | If you read the discussion in the thread I pointed to last night, `real' > | vi supposedly does thi

Re: Documentation issue

2017-10-26 Thread Eli Barzilay
Pierre Gaston: > I think it's even more likely to happen with eg: read array[i] Maybe, but see below. > There is a large number of pitfalls in bash > (http://mywiki.wooledge.org/BashPitfalls) that most people ignore. And it doesn't even mention the unset problem, I think. On Thu, Oct 26, 2017

Re: Documentation issue

2017-10-26 Thread Chet Ramey
On 10/26/17 11:28 AM, Eli Barzilay wrote: >> I'm not sure why this is a surprise. Pathname expansion (globbing) is >> one of the word expansions performed before a simple command is >> executed. The `unset' builtin is no different. > > The last sentence is showing why it's a surprise: it is confu

Re: Documentation issue

2017-10-26 Thread Eli Barzilay
On Thu, Oct 26, 2017 at 2:02 PM, Chet Ramey wrote: > > It's more of a general statement about arrays, though it appears in > the paragraph that discusses unset, so it's in the man page section on > arrays. You have to be careful about putting the same information in > too many different places --

Re: ctrl-w oddity on bash-4.4

2017-10-26 Thread Robert Elz
Date:Thu, 26 Oct 2017 10:04:54 -0400 From:Chet Ramey Message-ID: | Posix doesn't make that distinction. Actually, it does, Input Mode Commands in vi In text input mode, the current line shall consist of zero or more of the following categ

Re: ctrl-w oddity on bash-4.4

2017-10-26 Thread Robert Elz
I should have also said that's there's no requirement (that I can see anyway) that vi mode in readline be the same as vi. In fact, it obviously cannot be, it is just an editing mode that is somewhat similar to vi. There are going to be things missing (clearly there's no way, and no need, to cente

Re: ctrl-w oddity on bash-4.4

2017-10-26 Thread Chet Ramey
On 10/26/17 5:20 PM, Robert Elz wrote: > Date:Thu, 26 Oct 2017 10:04:54 -0400 > From:Chet Ramey > Message-ID: > > | Posix doesn't make that distinction. > > Actually, it does, > > Input Mode Commands in vi Interesting. The description of vi editing mode un

Re: ctrl-w oddity on bash-4.4

2017-10-26 Thread Chet Ramey
On 10/26/17 5:30 PM, Robert Elz wrote: > I should have also said that's there's no requirement (that I can see > anyway) that vi mode in readline be the same as vi. There isn't, and readline's vi mode doesn't attempt it. It only tries to implement what Posix defines as part of the `sh' description

Re: Documentation issue

2017-10-26 Thread Clark Wang
On Fri, Oct 27, 2017 at 3:00 AM, Eli Barzilay wrote: > On Thu, Oct 26, 2017 at 2:02 PM, Chet Ramey wrote: > > > > It's more of a general statement about arrays, though it appears in > > the paragraph that discusses unset, so it's in the man page section on > > arrays. You have to be careful abo

Re: Documentation issue

2017-10-26 Thread Eli Barzilay
On Thu, Oct 26, 2017 at 10:50 PM, Clark Wang wrote: > On Fri, Oct 27, 2017 at 3:00 AM, Eli Barzilay wrote: >> >> 1. Drop the current "Care must be taken ... the entire array." two >>sentences and replace them with some "See the unset builtin >>description below". > > It's not only about u

Re: Documentation issue

2017-10-26 Thread Clark Wang
On Fri, Oct 27, 2017 at 1:17 PM, Eli Barzilay wrote: > > I already said why `unset` is different. If it wasn't clear, a direct > example is the fact that `delete` in javascript is a special syntax > rather than a function. To make it more confusing, the other obvious > place where an lvalue app