admin管理员组文章数量:1123107
I have installed mikefarah/yq :
$ yq -V
yq (/) version v4.44.3
$
I want to create a JSON structure with yq.
I tried this yq
command :
yq -n -o=json '.a = 1,.b.c = 16 , .b.d = 12'
But I get this JSON output :
{
"a": 1,
"b": {
"c": 16,
"d": 12
}
}
{
"a": 1,
"b": {
"c": 16,
"d": 12
}
}
I expect this :
{
"a": 1,
"b": {
"c": 16,
"d": 12
}
}
I have installed mikefarah/yq :
$ yq -V
yq (https://github.com/mikefarah/yq/) version v4.44.3
$
I want to create a JSON structure with yq.
I tried this yq
command :
yq -n -o=json '.a = 1,.b.c = 16 , .b.d = 12'
But I get this JSON output :
{
"a": 1,
"b": {
"c": 16,
"d": 12
}
}
{
"a": 1,
"b": {
"c": 16,
"d": 12
}
}
I expect this :
{
"a": 1,
"b": {
"c": 16,
"d": 12
}
}
Share
Improve this question
asked 5 hours ago
SebMaSebMa
4,65936 silver badges48 bronze badges
1
- The only thing that's at all surprising here is that you have the output twice instead of three times, given the three comma-separated expressions. – Charles Duffy Commented 3 hours ago
1 Answer
Reset to default 2,
opens another context. Pipe into a new filter using |
to modify the same context:
yq -n -o=json '.a = 1 | .b.c = 16 | .b.d = 12'
{
"a": 1,
"b": {
"c": 16,
"d": 12
}
}
本文标签: Why do I get twice the same JSON output with mikefarahyqStack Overflow
版权声明:本文标题:Why do I get twice the same JSON output with mikefarahyq? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736548480a1944481.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论