On Sun, Oct 20, 2024 at 12:12:19PM +0000, Andy Smith wrote: > Hi, > > On Sun, Oct 20, 2024 at 08:38:45AM +0100, Chris Green wrote: > > Yes, but the output from 'ip link show' wraps a whole lot of other > > junk around the MAC address which I'd need to remove for the > > application I want it for. > > $ ip --json link show | jq '.[].address' > "00:00:00:00:00:00" > "10:7b:44:93:fa:c4" > "2e:7d:6c:1d:f7:dd" > "d2:1d:7d:50:18:08" > null > > The other output types of "ip" are also amenable to columnar selection.
+1 for jq. It's really worth the effort to wrap one's brain around that little gem. Cheers -- t
signature.asc
Description: PGP signature