Skip to content

"Rogue" filenames that contain a backslash break automatic globbing for native commands on macOS and Linux #10682

@mklement0

Description

@mklement0

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions