You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Rogue" filenames that contain a backslash break automatic globbing for native commands on macOS and Linux #10682
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-DuplicateThe issue is a duplicate.WG-Enginecore PowerShell engine, interpreter, and runtime
Note: This case is covered by catch-all issue #9244
The presence of a filename containing a \ that matches a wildcard pattern causes native globbing to fail quietly (and pass the pattern through as-is, as if nothing matched).
Note that \ is a legal filename character on Unix-like platforms.
Steps to reproduce
On macOS and Linux:
touch 'a\b'/bin/echo *| Should -Not-Be '*'
rm 'a\b'
Expected behavior
The test should pass.
Actual behavior
The test fails, because * is echoed as-is - no expansion to matching filenames occurs.
Windows is not affected, because native globbing isn't applied there).
Environment data
PowerShell Core v7.0.0-preview.4 on macOS 10.14.6
PowerShell Core v7.0.0-preview.4 (7.0.0-preview.4) on Ubuntu 18.04.3 LTS
changed the title [-]Automatic globbing for native commands is broken on macOS[/-][+]"Rogue" filenames break automatic globbing for native commands on macOS and Linux[/+]on Oct 7, 2019
changed the title [-]"Rogue" filenames break automatic globbing for native commands on macOS and Linux[/-][+]"Rouge" filenames that contain a backslash break automatic globbing for native commands on macOS and Linux[/+]on Oct 7, 2019
The version is stated in the OP, and I originally thought it affects macOS only - but (a) that isn't true and (b) the problem is much more specific - please see the updated title and OP.
changed the title [-]"Rouge" filenames that contain a backslash break automatic globbing for native commands on macOS and Linux[/-][+]"Rogue" filenames that contain a backslash break automatic globbing for native commands on macOS and Linux[/+]on Oct 7, 2019
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-DuplicateThe issue is a duplicate.WG-Enginecore PowerShell engine, interpreter, and runtime
Activity
iSazonov commentedon Oct 7, 2019
Which version?
Does it work on Linux?
[-]Automatic globbing for native commands is broken on macOS[/-][+]"Rogue" filenames break automatic globbing for native commands on macOS and Linux[/+][-]"Rogue" filenames break automatic globbing for native commands on macOS and Linux[/-][+]"Rouge" filenames that contain a backslash break automatic globbing for native commands on macOS and Linux[/+]mklement0 commentedon Oct 7, 2019
The version is stated in the OP, and I originally thought it affects macOS only - but (a) that isn't true and (b) the problem is much more specific - please see the updated title and OP.
mklement0 commentedon Oct 7, 2019
Never mind: I just realized that all backslash-escaped woes are covered in #9244, though I'll add a note there about this specific scenario.
[-]"Rouge" filenames that contain a backslash break automatic globbing for native commands on macOS and Linux[/-][+]"Rogue" filenames that contain a backslash break automatic globbing for native commands on macOS and Linux[/+]