Using latest version of jq from github (along with v1.5 installed in ubuntu 17.04):
The following command result in incorrect output:
Command:
echo -n '{"b": {"c": 3}, "a": 2}{"b": {"e": 4}, "d": 3}' | jq -s '.'
Output:
[
{
"b": {
"c": 3
},
"a": 2
}
]
{
"b": {
"e": 4
},
"d": 3
}
on the other hand if use "echo" rather than"echo -n" the results are as expected:
Command:
echo '{"b": {"c": 3}, "a": 2}{"b": {"e": 4}, "d": 3}' | jq -s '.'
Output:
[
{
"b": {
"c": 3
},
"a": 2
},
{
"b": {
"e": 4
},
"d": 3
}
]
I have tested both above commands with jq 1.3 and both "echo" and "echo -n" work fine. so there has been a regression from 1.3 to 1.5.
Seeing this too on v1.5.
> echo -n '{"a": 1} {"b": 2} {"c": 3}' | jq -s .
[
{
"a": 1
}
]
{
"b": 2
}
{
"c": 3
}
Bisected: 0d414471bb41f41373754c680ecc7f955a9ec2ad introduces the regression
Just to be clear, the problem was fixed after the release of jq 1.5, and it seems to have stayed fixed -- using the current "master":
$ echo -n '{"a": 1} {"b": 2} {"c": 3}' | jq -s .
[
{
"a": 1
},
{
"b": 2
},
{
"c": 3
}
]
You're right; it looks like the fix for #1534 fixed this as well (in f06deb828a318536b85d68280d429c3a70b21259). I guess this can be closed then, if someone who has the ability to do so can.
Most helpful comment
Seeing this too on v1.5.