[Lldb-commits] [lldb] [lldb] Escape ? for zsh (PR #112107)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 14 02:12:57 PDT 2024


labath wrote:

So... `?` is a glob character (in just about any shell), just like `*`. And lldb-argdumper is only reason for existence is to expand globs, so escaping it sounds wrong. I think the main difference here is that zsh complains loudly about a failed glob expansion, where as bash just leaves it alone (although this can be controlled with some settings). However, this behavior is not specific to `?` -- you can get the same thing with `*` as well:
```
$ zsh -c 'echo bin/lld?'
bin/lldb
$ zsh -c 'echo bin/lld?'
bin/lldb
$ zsh -c 'echo bin/lld*'
bin/lld bin/lld-link bin/lldb bin/lldb-argdumper bin/lldb-dap bin/lldb-dotest bin/lldb-instr bin/lldb-python bin/lldb-repro bin/lldb-server bin/lldb-tblgen bin/lldb-test
$ zsh -c 'echo bin/not-lld?'
zsh:1: no matches found: bin/not-lld?
$ zsh -c 'echo bin/not-lld*'
zsh:1: no matches found: bin/not-lld*
$ bash -c 'echo bin/lld?'
bin/lldb
$ bash -c 'echo bin/lld*'
bin/lld bin/lld-link bin/lldb bin/lldb-argdumper bin/lldb-dap bin/lldb-dotest bin/lldb-instr bin/lldb-python bin/lldb-repro bin/lldb-server bin/lldb-tblgen bin/lldb-test
$ bash -c 'echo bin/not-lld*'
bin/not-lld*
$ bash -c 'echo bin/not-lld?'
bin/not-lld?
```

https://github.com/llvm/llvm-project/pull/112107


More information about the lldb-commits mailing list