Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: strange glob parsing



On Tue 3 Jun 2025, at 00:10, Lawrence Velázquez wrote:
> Right, but the difference is that shell pattern matching shouldn't
> throw an error in this case: ...

oh, yeah. i think i confused myself trying to respond to something you
didn't actually say

On Tue 3 Jun 2025, at 00:10, Lawrence Velázquez wrote:
> They do match in bash, but they match the strings "[]" and "[^]"
> literally, which is admittedly hard to see.  The failglob shopt
> helps: ...
> 	/tmp/foo.bash: line 5: no match: []
> 	/tmp/foo.bash: line 6: no match: [!]
> 	/tmp/foo.bash: line 7: no match: [^]

i had tested this and was confused by it as well -- why should the glob
patterns fail if they're not glob patterns? it does this even in posix
mode (though ofc failglob itself isn't posix)

On Tue 3 Jun 2025, at 00:10, Lawrence Velázquez wrote:
> If nothing else, it might be worth considering an adjustment to
> sh/ksh compatibility mode.

yeah. it would have to be more than just short-circuiting that test
since it didn't act posix-y even before the change

dana




Messages sorted by: Reverse Date, Date, Thread, Author