4 ms·
I guess they mean something like this, which I find useful at quickly iterating over jq fzf --print-query --preview-window wrap --no-clear --preview 'cat fil
by gnyman 5y ago
I guess they mean something like this, which I find useful at quickly iterating over jq
fzf --print-query --preview-window wrap --no-clear --preview 'cat file.json | jq {q}'
you can also pipe a curl in the above, but that will mean a lot of (slow) requests, so I have this snippet saved for running fzf --preview with jq on something from a web service
curl -L https://datahub.io/core/covid-19/r/worldwide-aggregate.json > /tmp/foo && echo '' | fzf --print-query --preview-window wrap --no-clear --preview 'cat /tmp/foo | jq {q}'
now if you write something like
.[0]["Confirmed"]
you will get a live preview of the result as you type
I did not know about `jiq`, so thanks for that tip, it looks like it does the same or something similar, but without the extra cruft of storing a temp file
- aarchi 5y agoIt can be just `jq {q} file.json`. No need for `cat`.