Skip to content

Native globbing on Unix platforms should pass syntactically-invalid-as-globbing-patterns unquoted literals through as-is #4971

@mklement0

Description

@mklement0

Related: #3931

An unquoted token that is not a syntactically valid globbing pattern (wildcard expression) should be considered a literal to be passed as-is - not an error.

Note that, by default, bash retains whatever unquoted token you specify as-is, if it (a) happens not to be a valid globbing pattern or (b) happens not to match any files.
(Setting shopt -s nullglob, however, would result in syntactically valid non-matching globs evaluating to the empty string).

Steps to reproduce (Unix platforms)

/bin/echo []

Expected behavior

[]

Actual behavior

The specified wildcard character pattern is not valid: []
...

Environment data

PowerShell Core v6.0.0-beta.7 on macOS 10.12.6
PowerShell Core v6.0.0-beta.7 on Ubuntu 16.04.3 LTS
PowerShell Core v6.0.0-beta.7 on Microsoft Windows 10 Pro (64-bit; v10.0.15063)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-FixedThe issue is fixed.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