Yq: Can't pipe into yq

Created on 28 Dec 2017  路  6Comments  路  Source: mikefarah/yq

Piping into yq with my.yml | yq does not seem to work, which limits usability for scripting on linux severely. This needs to be supported.

Most helpful comment

So looks like yq r - -d '*' is the solution to pipe to yq.

echo -e '---
foo:bar
---
buzz:42
' | yq r - -d '*'

All 6 comments

You have to do this yq r -. Really wish this was simpler.

echo -e '---
foo: bar' | yq r -

Also it doesn't work reliably with tools like helm. It only returns the first yaml document, even if there are more.

```
helm template foo
````

That's what it does by default, you can specify a specific document or all documents:

http://mikefarah.github.io/yq/read/#multiple-documents-specify-a-single-document

So looks like yq r - -d '*' is the solution to pipe to yq.

echo -e '---
foo:bar
---
buzz:42
' | yq r - -d '*'

I hope the defaults will change to something smarter . To just do mycommand | yq just like jq.

Hi guys, I see It does not do the syntax highlighting when piped. Please help!

ppp

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dakky picture dakky  路  5Comments

rgm3 picture rgm3  路  7Comments

IdanAdar picture IdanAdar  路  9Comments

jmreicha picture jmreicha  路  5Comments

infa-ddeore picture infa-ddeore  路  5Comments