I try to get all the wireless interfaces that are available on a computer. For example if I use two network cards with logical name  wlan0 and  ra0  respectively then I want to print them.This is what I tried but I don't get any output:sudo lshw -C network | awk 'if (/description: / $2 == Wireless) {  /logical name: /{printf $3 \n;}}'I get syntax errors:awk: line 1: syntax error at or near ifawk: line 1: syntax error at or near }Output without the awk part:*-network                      description: Network controller       product: BCM4313 802.11bgn Wireless Network Adapter       vendor: Broadcom Corporation       physical id: 0       bus info: pci@0000:05:00.0       version: 01       width: 64 bits       clock: 33MHz       capabilities: pm msi pciexpress bus_master cap_list       configuration: driver=bcma-pci-bridge latency=0       resources: irq:17 memory:96400000-96403fff  *-network       description: Ethernet interface       product: RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller       vendor: Realtek Semiconductor Co., Ltd.       physical id: 0       bus info: pci@0000:06:00.0       logical name: enp6s0       version: 02       serial: 88:ae:1d:da:9e:99       size: 10Mbit/s       capacity: 100Mbit/s       width: 64 bits       clock: 33MHz       capabilities: pm msi pciexpress msix vpd bus_master cap_list rom ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half latency=0 link=no multicast=yes port=MII speed=10Mbit/s       resources: irq:24 ioport:2000(size=256) memory:92410000-92410fff memory:92400000-9240ffff memory:95400000-9541ffff  *-network       description: Wireless interface       physical id: 3       logical name: wlp5s0b1       serial: 00:26:82:e7:b8:32       capabilities: ethernet physical wireless       configuration: broadcast=yes driver=brcmsmac driverversion=4.4.0-53-generic firmware=610.812 ip=192.168.0.14 link=yes multicast=yes wireless=IEEE 802.11bgnUpdate: If there is a better way to get what I want then I'd be happy to accept such answer. 
Get wireless intefaces logical name
shell script;awk
awk -F:  -v line=-1 '{if($2==Wireless interface){ line=NR+2}; if (line==NR){print $2}}' youfile-F set the separator-v pass a variable with valueNR line numberI get the second item from the second line after i get Wireless interface