iwconfig zsh completion: replace egrep usage with grep -E
authorMichael Prokop <mika@grml.org>
Wed, 7 Sep 2022 11:54:43 +0000 (13:54 +0200)
committerMichael Prokop <mika@grml.org>
Wed, 7 Sep 2022 11:54:43 +0000 (13:54 +0200)
grep 3.8 deprecated support for egrep + fgrep, and now prints a warning on stderr:

| egrep: warning: egrep is obsolescent; using grep -E
| fgrep: warning: fgrep is obsolescent; using grep -F

usr_share_grml/zsh/completion/linux/_iwconfig

index 6731597..27e71ae 100644 (file)
@@ -2,8 +2,8 @@
 
 _wlan_interfaces() {
     local intf
-    intf=$(iwconfig |& egrep 'IEEE 802.11[abg]' | cut -d' ' -f1 | tr ' ' \\n )
-    # intf=$( fgrep ': ' < /proc/net/wireless | cut -d: -f1 | tr \\n ' ' | tr -s " \t" )
+    intf=$(iwconfig |& grep -E 'IEEE 802.11[abg]' | cut -d' ' -f1 | tr ' ' \\n )
+    # intf=$( grep -F ': ' < /proc/net/wireless | cut -d: -f1 | tr \\n ' ' | tr -s " \t" )
     _wanted interfaces expl 'wireless network interface' \
         compadd ${intf}
 }