Skip to content

handling selectors with '.' within the element name #139

Answered by TomWright
link4531 asked this question in Q&A
Discussion options

You must be logged in to vote

You just need to escape the dot. The backslash does do this, but you are putting in the wrong place. The backslash needs to come before the character you want to escape.

E.g.

 echo 'this.file:
  - this.attribute: value' | dasel put string -p yaml '.this\.file.[0].this\.attribute' newvalue
this.file:
- this.attribute: newvalue

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@link4531
Comment options

Answer selected by TomWright
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants