Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #15696
| From | Chet Ramey <chet.ramey@case.edu> |
|---|---|
| Newsgroups | gnu.bash.bug |
| Subject | Re: Backslash missing in brace expansion |
| Date | 2019-12-05 12:01 -0800 |
| Organization | ITS, Case Western Reserve University |
| Message-ID | <mailman.363.1575576131.1979.bug-bash@gnu.org> (permalink) |
| References | <20191205201157.cd481936f76d95bbdfabc73c@schrader-schulte.de> <662e2328-f331-c554-afcf-fd3819f6beab@case.edu> |
On 12/5/19 11:11 AM, Martin Schulte wrote:
> Hello,
>
> please have a look:
>
> $ uname -a
> Linux martnix4 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3+deb9u2 (2019-11-11)
> x86_64 GNU/Linux $ echo ${BASH_VERSINFO[@]}
> 4 4 12 1 release x86_64-pc-linux-gnu
> $ set -x
> $ echo {Z..a}
> + echo Z '[' '' ']' '^' _ '`' a
> Z [ ] ^ _ ` a
>
> It looks as if the backslash (between [ and ] in ASCII code) is missing in
> brace expansion. The same behaviour seems to be found in bash 5.0.
It's an unquoted backslash, which is removed by quote removal when the
words are expanded. Look at the extra space between `[' and `]'; that's
the null argument resulting from the unquoted backslash.
--
``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
Re: Backslash missing in brace expansion Chet Ramey <chet.ramey@case.edu> - 2019-12-05 12:01 -0800
csiph-web