4 ms·
Gah i got bit by this with 'jq'! > $ echo "{}" | jq > {} > $ echo "{}" | jq > out.json > jq - commandline JSON processor [version 1.5-1-a5b5cbe] ... etc ...
by anitil 6y ago
Gah i got bit by this with 'jq'!
> $ echo "{}" | jq
> {}
> $ echo "{}" | jq > out.json
> jq - commandline JSON processor [version 1.5-1-a5b5cbe]
... etc ...
Turns out when stdout isn't a tty you _must_ specify a filter (in this case '.')
- inetknght 6y agoYup! I had the same problem too. It was 'fixed' in jq 1.6, such that it now assumes `.` is the filter if no program arguments are provided [0]. It happens all the time with anything systemd or networkmanager too [0]: https://github.com/stedolan/jq/releases/tag/jq-1.6 https://github.com/stedolan/jq/releases/tag/jq-1.6
- deleted 6y ago[deleted]