A way for jq to output paths in a way itself can read?
<p>Is there a way to make <code>jq</code> output paths in a way itself can read?</p>

<p>Example input:</p>

<pre><code>{
    "foo": [{
        "bar": 2,
        "bor": 3
    }]
}
</code></pre>

<p>Output the location and value of "bar" by e.g.:</p>

<pre><code>jq -c 'tostream | select(.[0]|index("bar"))'
[["foo",0,"bar"],2]
</code></pre>

<p>Is there a way to instead output the path in the <code>jq</code> path selection format, i.e. <code>.foo[0].bar</code>?</p>