I'm trying to select the first interface with yq
(the Github mikefarah/yq version) on /etc/netplan/00-installer-config.yaml :
$ cat /etc/netplan/00-installer-config.yaml
# This is the network config written by 'subiquity'
network:
ethernets:
ens160:
link-local: []
addresses: [x.y.z.t/24]
routes:
- to: default
via: x.y.z.1
ens192:
link-local: []
addresses: [a.b.c.d/24]
version: 2
$ cat /etc/netplan/00-installer-config.yaml | yq '.network.ethernets[0]'
null
$ cat /etc/netplan/00-installer-config.yaml | yq '.network.ethernets.ens*[0]'
null
null
How do I do that with yq
?