[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Documentation issue
From: |
Chet Ramey |
Subject: |
Re: Documentation issue |
Date: |
Thu, 26 Oct 2017 08:56:37 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
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 one
of the word expansions performed before a simple command is executed. The
`unset' builtin is no different.
> The thing is that AFAICT, there is no mention of this pitfall in the man
> page...
"The unset builtin is used to destroy arrays. unset name[subscript]
destroys the array element at index subscript. Negative subscripts to
indexed arrays are interpreted as described above. Care must be taken
to avoid unwanted side effects caused by pathname expansion."
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/
- Documentation issue, Eli Barzilay, 2017/10/26
- Re: Documentation issue, Pierre Gaston, 2017/10/26
- Re: Documentation issue,
Chet Ramey <=
- Re: Documentation issue, Eli Barzilay, 2017/10/26
- Re: Documentation issue, Chet Ramey, 2017/10/26
- Re: Documentation issue, Eli Barzilay, 2017/10/26
- Re: Documentation issue, Clark Wang, 2017/10/26
- Re: Documentation issue, Eli Barzilay, 2017/10/27
- Re: Documentation issue, Clark Wang, 2017/10/27
- Re: Documentation issue, Eli Barzilay, 2017/10/27
- Re: Documentation issue, Clark Wang, 2017/10/29
- Re: Documentation issue, Eli Barzilay, 2017/10/30
- Re: Documentation issue, Greg Wooledge, 2017/10/30