Interpolation when key contain special character (e.g., space)
Author: aubertcCreated Aug 18, 2026Updated Aug 18, 2026
Labelsbugv4
Describe the bug
I expect the command
yq '"Test: \( .["First name"])"' data.yamlto be correctly parsed as a string interpolation looking at displaying the value corresponding to the key First name.
Version of yq: yq (https://github.com/mikefarah/yq/) version v4.53.3 Operating system: Debian Installed via: binary release
Input Yaml
data.yml:
value: things
First name: BillCommand The command you ran:
yq '"Test: \( .["First name"])"' data.yamlActual behaviour
Error: 1:14: lexer: invalid input text "First name\"])\""Note that
yq '"Test: \( .value)"' data.yamlworks as expected by returning
Test: thingsExpected behaviour
Test: BillSource: mikefarah/yq