Length
Last updated
Returns the lengths of the nodes. Length is defined according to the type of the node.
returns length of string
Given a sample.yml file of:
a: catthen
yq '.a | length' sample.ymlwill output
3Given a sample.yml file of:
a: nullthen
yq '.a | length' sample.ymlwill output
0returns number of entries
Given a sample.yml file of:
then
will output
returns number of elements
Given a sample.yml file of:
then
will output
Last updated
a: cat
c: dogyq 'length' sample.yml2- 2
- 4
- 6
- 8yq 'length' sample.yml4