Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

In Linux, Find Command Fails Even With Quoted and Escaped Asterisk #4680

Copy link
Copy link
@bigboy-pdb-spam

Description

@bigboy-pdb-spam
Issue body actions

Steps to reproduce

PS> touch ab.txt 'a b.txt'

# Question mark character works

PS> find -name 'a?.txt'
ab.txt

PS> find -name 'a??.txt'
a b.txt

# Asterisk appears to be being expanded into file names

PS> find -name 'a*b.txt'
/usr/bin/find: paths must precede expression: ab.txt
Usage: /usr/bin/find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec|time] [path...] [expression]

# Escaping asterisk doesn't work

PS> find -name 'a`*b.txt'
# No output, which indicates the parameters were accepted, but the search produced no results.

Expected behavior

PS> find -name 'a*b.txt'
./ab.txt
./a b.txt

Actual behavior

PS> find -name 'a*b.txt'
/usr/bin/find: paths must precede expression: ab.txt
Usage: /usr/bin/find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec|time] [path...] [expression]

It appears that the command is being converted into: find -name 'a b.txt' 'ab.txt'

Environment data

> $PSVersionTable
Name                           Value                                           
----                           -----                                           
PSVersion                      6.0.0-beta                                      
PSEdition                      Core                                            
GitCommitId                    v6.0.0-beta.6                                   
OS                             Linux 4.4.0-92-generic #115-Ubuntu SMP Thu Au...
Platform                       Unix                                            
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                         
PSRemotingProtocolVersion      2.3                                             
SerializationVersion           1.1.0.1                                         
WSManStackVersion              3.0 
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.