Skip to content

Cannot figure out how to disable globbing for rm #567

@binki

Description

@binki

Node version (or tell us if you're using electron or some other framework):

v6.4.0
v7.0.0

ShellJS version (the most recent version/Github branch you see the bug on):

0.7.5

Operating system:

Windows10 x64
Microsoft Windows [Version 10.0.14971]

Linux

Description of the bug:

I cannot figure out how to escape globs in filename patterns when using rm. If I quote the argument in single quotes, rm says it can’t find anything. If I only escape it from my shell, the globstar is still expanded by rm.

ohnobinki@gibby /tmp/.private/ohnobinki/shelljsplay $ mkdir -p a/\*\*/b
ohnobinki@gibby /tmp/.private/ohnobinki/shelljsplay $ mkdir -p a/d/b
ohnobinki@gibby /tmp/.private/ohnobinki/shelljsplay $ echo x1 > a/\*\*/b/x.txt
ohnobinki@gibby /tmp/.private/ohnobinki/shelljsplay $ echo x2 > a/d/b/x.txt
ohnobinki@gibby /tmp/.private/ohnobinki/shelljsplay $ cat a/d/b/x.txt
x2
ohnobinki@gibby /tmp/.private/ohnobinki/shelljsplay $ node_modules/.bin/shx rm "'a/**/b/x.txt'"
rm: no such file or directory: 'a/**/b/x.txt'
ohnobinki@gibby /tmp/.private/ohnobinki/shelljsplay $ node_modules/.bin/shx rm a/\*\*/b/x.txt
ohnobinki@gibby /tmp/.private/ohnobinki/shelljsplay $ find a -print
a
a/d
a/d/b
a/**
a/**/b
ohnobinki@gibby /tmp/.private/ohnobinki/shelljsplay $ cat a/d/b/x.txt
cat: a/d/b/x.txt: No such file or directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions