[issue39856] glob : some 'unix style' glob items are not supported

Je GeVa report at bugs.python.org
Fri Mar 6 03:54:33 EST 2020


Je GeVa <jejeva.bxl at gmail.com> added the comment:

well ;

1) tilde expansion
this is an issue

2) brace expansion
have no clue how the engineers at the fruity company maimed your bash and
zsh man but brace expansion is core to both of them.
https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html
http://zsh.sourceforge.net/Doc/Release/Expansion.html#Brace-Expansion

hence :

BASH
/tmp/testdir_issue39856$ $SHELL --version|head -n1
GNU bash, version 5.0.3(1)-release (x86_64-pc-linux-gnu)
/tmp/testdir_issue39856$ ls
hello_1.py  hello_2.py  hello_3.py
/tmp/testdir_issue39856$ ls hell*{1,2}.*
hello_1.py  hello_2.py
/tmp/testdir_issue39856$ ls hell*{1..3}.*
hello_1.py  hello_2.py  hello_3.py

ZSH
nocte% $SHELL --version|head -n1
zsh 5.8 (x86_64-debian-linux-gnu)
nocte% ls hell*{1,2}.*
hello_1.py  hello_2.py
nocte% ls hell*{1..3}.*
hello_1.py  hello_2.py  hello_3.py

TCSH
nocte:/tmp/testdir_issue39856> /bin/tcsh --version
tcsh 6.21.00 (Astron) 2019-05-08 (x86_64-unknown-linux) options
wide,nls,dl,al,kan,sm,rh,nd,color,filec
nocte:/tmp/testdir_issue39856> ls hell*{1,2}.*
hello_1.py  hello_2.py

for history sake :
https://unix.stackexchange.com/questions/92819/why-is-brace-expansion-not-supported

Apparently :

"While brace expansion like {1,2} originates in csh in the late 70s, and
found its way to Bourne-like shells in bash/zsh/pdksh in the late 80s,
early 90s, the {n1..n2} variant came later first in zsh in 1995 (2.6-beta4).
bash copied it in 2004 (3.0) and ksh93 in 2005 (ksh93r)."
since glob claims the "unix style" and bash is the default unix shell, i
believe it should support it (or maybe change the tatile to 'unix from 40
years ago style' ),
i stand by the issue,

and Kart, on a side note i would sincerely update my base tools if i were
you, bash 3.2 is vulnerable to shellshock for exemple...

Le jeu. 5 mars 2020 à 04:58, Karthikeyan Singaravelan <
report at bugs.python.org> a écrit :

>
> Karthikeyan Singaravelan <tir.karthi at gmail.com> added the comment:
>
> This seems to be similar to issue9584. Below are the results in my zsh and
> bash in Mac.
>
> bash
>
> bash-3.2$ cd /tmp/
> bash-3.2$ ls *py
> hello_1.py      hello_2.py      hello_3.py
> bash-3.2$ ls hell*{1-2}.*
> ls: hell*{1-2}.*: No such file or directory
> bash-3.2$ ls hell*[1-2].*
> hello_1.py      hello_2.py
>
> zsh
>
> ➜  /tmp ls *py
> hello_1.py hello_2.py hello_3.py
> ➜  /tmp ls hell*{1-2}.*
> zsh: no matches found: hell*{1-2}.*
> ➜  /tmp ls hell*[1-2].*
> hello_1.py hello_2.py
>
> Try using []
>
> >>> import glob
> >>> glob.glob("hell*[1-2].*")
> ['hello_2.py', 'hello_1.py']
>
> ----------
> nosy: +serhiy.storchaka, xtreak
> type:  -> behavior
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <https://bugs.python.org/issue39856>
> _______________________________________
>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39856>
_______________________________________


More information about the Python-bugs-list mailing list