Skip to content

Escaping spaces in Windows CMD or Powershell doesn't work #777

Open
@deefstes

Description

@deefstes

Describe the bug
When evaluating an expression that contains spaces against a yaml file, escaping the spaces do not work in Windows CMD or in Powershell. However, when evaluating the same expression against a new yaml file (--null-input flag), it works as expected.

Version of yq: 4.6.3
Operating system: Windows
Installed via: Downloaded latest binary

Input Yaml

a: true
b: 2

Command
In CMD.exe

yq e ".c = ""something" new""" sample.yml

or in Powershell:

yq e '.c = ""something" new""' sample.yml

Actual behavior

Error: open .c = "something new" sample.yaml: The filename, directory name, or volume label syntax is incorrect.

Expected behavior

a: true
b: 2
c: something new

Additional context
The following command did run as expected:
In CMD.exe

yq e -n ".c = ""something" new"""

or in Powershell:

yq e -n '.c = ""something" new""'

Observed behavior

c: something new

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions