Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#2817·yq

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.yaml

to 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:

yaml
value: things
First name: Bill

Command The command you ran:

yq '"Test: \( .["First name"])"' data.yaml

Actual behaviour

Error: 1:14: lexer: invalid input text "First name\"])\""

Note that

yq '"Test: \( .value)"' data.yaml

works as expected by returning

Test: things

Expected behaviour

yaml
Test: Bill

Source: mikefarah/yq

View original on GitHubView discussion on GitHub