summaryrefslogtreecommitdiff
path: root/.config/bash
diff options
context:
space:
mode:
authorben <benjaminfranzke@googlemail.com>2010-10-14 19:39:24 +0200
committerben <benjaminfranzke@googlemail.com>2010-10-14 19:39:24 +0200
commit01fe13624d6a8bb7a7886ac6131edc1dd854b34d (patch)
treed4f5164a245cd24c9973fc61737b75ea435837db /.config/bash
parent85af48a18caaad43091fa071e3ee06cce4d7accb (diff)
downloaddotfiles-01fe13624d6a8bb7a7886ac6131edc1dd854b34d.tar.gz
dotfiles-01fe13624d6a8bb7a7886ac6131edc1dd854b34d.tar.bz2
dotfiles-01fe13624d6a8bb7a7886ac6131edc1dd854b34d.zip
add wscan function for parsing iw output
Diffstat (limited to '.config/bash')
-rw-r--r--.config/bash/functions.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/.config/bash/functions.sh b/.config/bash/functions.sh
index ae7329b..c644247 100644
--- a/.config/bash/functions.sh
+++ b/.config/bash/functions.sh
@@ -232,3 +232,10 @@ die() {
echo " * ${*:-(no error message)}"
}
+wscan() {
+ local dev=$1
+ local pattern=$2
+
+ iw $dev scan | \
+ sed -e '/^[^\t]/{x;p;x;}' | sed -e '/./{H;$!d;}' -e "x;/$pattern/!d;" | sed "/^$/d"
+}