Podemos fazer isso com sed:
#!/bin/sed -nf
# If it begins with anything except whitespace, trim it down to the
# bit before ":", and store that into hold space.
/^[^ ]/{
s/:.*//
h
}
# If we see "parent: eth0", then print the hold space.
/parent: eth0/{
g
p
}
Com sua entrada, isso gera vlan01
(e uma nova linha).