Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Automatic globbing for native commands doesn't work with backtick-escaped spaces #10683
When calling external programs (native programs), wildcard patterns that you want automatic globbing applied to (as in Bash, for instance) must be unquoted, i.e. they must neither be enclosed in single quotes nor in double quotes.
Therefore, if you want globbing to be applied to a wildcard pattern that has spaces, for instance, you need to individually escape the space, namely as
However, the automatic globbing mechanism currently doesn't recognize that and doesn't expand such patterns.
Steps to reproduce
On Linux (native globbing is currently fundamentally broken on macOS, and isn't applied on Windows)
Push-Location temp:/ touch 'a b.txt' /bin/echo a` * | Should -Be 'a b.txt' Remove-Item 'a b.txt' Pop-Location
The test should succeed.
The test fails, because the pattern is not expanded (