How to convert a json response into yaml in bash

后端 未结 6 1960
不知归路
不知归路 2020-12-31 11:04

I read data from a json file with jq. I wanna append the results into a yaml file, but I dont get it working. I am quite new to shell programming. My goal is to append that

6条回答
  •  遥遥无期
    2020-12-31 11:57

    With yq version 3.3.2:

    cat $DEFAULTS_FILE | yq r -P -

    yq a yaml wrapper for jq

    r read

    -P --prettyPrint

    - from STDIN

提交回复
热议问题