Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15321

Re: Documentation about destroying an array element

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: Documentation about destroying an array element
Date 2019-08-15 10:16 -0400
Message-ID <mailman.145.1565878631.30381.bug-bash@gnu.org> (permalink)
References <a42743d24f591a9adccc6613b1091473@saunalahti.fi> <20190815131828.GP1218@eeg.ccf.org> <f1a9c0ad-8c80-528f-766f-bd655ca57bef@case.edu>

Show all headers | View raw


On 8/15/19 9:18 AM, Greg Wooledge wrote:
> On Thu, Aug 15, 2019 at 12:37:01PM +0300, jarno.suni@saunalahti.fi wrote:
>> https://www.gnu.org/software/bash/manual/html_node/Arrays.html tells
>> "unset name[subscript] destroys the array element at index subscript."
>>
>> But if there is a file named names, nameu ,nameb, namec, namer, namei, namep
>> or namet in currenct directory, that does not work, unless globbing is
>> disabled (set -o noglob).
>>
>> So quoting should be stressed in the manual.
>>
>> BASH_VERSION 4.4.20(1)-release
> 
> It actually *is* mentioned in the manual, in 4.4.  But that sentence was
> removed in version 5.0 for some reason.

That sentence was removed and replaced with an entire paragraph:

"When  using  a  variable name with a subscript as an argument to a com-
mand, such as with unset,  without  using  the  word  expansion  syntax
described  above,  the  argument  is subject to pathname expansion.  If
pathname expansion is not desired, the argument should be quoted."

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Documentation about destroying an array element Chet Ramey <chet.ramey@case.edu> - 2019-08-15 10:16 -0400

csiph-web