Skip to content

Put document question #132

Answered by TomWright
link4531 asked this question in Q&A
May 5, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

You need to wrap the cat argument in double quotes so as it's picked up as a single string:

$ echo '{"people":[]}' | dasel put document -p json -d yaml '.people.[]' "$(cat doc.yaml)"
{
  "people": [
    {
      "color": "red",
      "name": "tom"
    }
  ]
}

In your example, dasel is essentially given a null value which is why you got that result.

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