Skip to content

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

Closed

Description

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

Activity

  1. added
    Issue-Question
    on Oct 2, 2019
  2. iSazonov commented on Oct 7, 2019

    @iSazonov
    Collaborator

    Note: This is a regression.

    Which version?

    Does it work on Linux?

  3. added
    WG-Engine
    on Oct 7, 2019
  4. 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
  5. 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
  6. mklement0 commented on Oct 7, 2019

    @mklement0
    ContributorAuthor

    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.

  7. mklement0 commented on Oct 7, 2019

    @mklement0
    ContributorAuthor

    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.

  8. 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-QuestionResolution-DuplicateWG-Engine

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions