develooper Front page | perl.perl6.users | Postings from August 2017

another one liner

Thread Next
From:
ToddAndMargo
Date:
August 5, 2017 02:12
Subject:
another one liner
Message ID:
0ebb5cd2-b160-629c-bdee-7cf01d328e40@zoho.com
Hi All,

How would you convert this one liner over to a Perl 6 one
liner with a pipe?

ifconfig | grep flags | awk '{print $1}' | sort | sed -n 2,2p | sed -e 
's/://'

enp6s0


Many thanks,
-T



# ifconfig
br0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
         inet 192.168.255.10  netmask 255.255.255.0  broadcast 
192.168.255.255
         inet6 fe80::1886:e8ff:fefb:50c  prefixlen 64  scopeid 0x20<link>
         ether 00:00:00:00:00:00  txqueuelen 1000  (Ethernet)
         RX packets 161335  bytes 10919435 (10.4 MiB)
         RX errors 0  dropped 0  overruns 0  frame 0
         TX packets 200479  bytes 144493201 (137.7 MiB)
         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp6s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
         ether 00:25:90:20:3b:2a  txqueuelen 1000  (Ethernet)
         RX packets 0  bytes 0 (0.0 B)
         RX errors 0  dropped 0  overruns 0  frame 0
         TX packets 0  bytes 0 (0.0 B)
         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
         device interrupt 16  memory 0xfbbe0000-fbc00000

enp7s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
         inet 192.168.250.135  netmask 255.255.255.0  broadcast 
192.168.250.255
         inet6 fe80::225:90ff:fe20:3b2b  prefixlen 64  scopeid 0x20<link>
         ether 00:25:90:20:3b:2b  txqueuelen 1000  (Ethernet)
         RX packets 334640  bytes 239842580 (228.7 MiB)
         RX errors 0  dropped 0  overruns 0  frame 0
         TX packets 234430  bytes 22392804 (21.3 MiB)
         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
         device interrupt 17  memory 0xfbce0000-fbd00000

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
         inet 127.0.0.1  netmask 255.0.0.0
         inet6 ::1  prefixlen 128  scopeid 0x10<host>
         loop  txqueuelen 1  (Local Loopback)
         RX packets 362568  bytes 736235075 (702.1 MiB)
         RX errors 0  dropped 0  overruns 0  frame 0
         TX packets 362568  bytes 736235075 (702.1 MiB)
         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
         inet 192.168.122.1  netmask 255.255.255.0  broadcast 
192.168.122.255
         ether 52:54:00:6e:23:13  txqueuelen 1000  (Ethernet)
         RX packets 0  bytes 0 (0.0 B)
         RX errors 0  dropped 0  overruns 0  frame 0
         TX packets 0  bytes 0 (0.0 B)
         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About