diff options
author | ben <benjaminfranzke@googlemail.com> | 2010-10-14 19:39:24 +0200 |
---|---|---|
committer | ben <benjaminfranzke@googlemail.com> | 2010-10-14 19:39:24 +0200 |
commit | 01fe13624d6a8bb7a7886ac6131edc1dd854b34d (patch) | |
tree | d4f5164a245cd24c9973fc61737b75ea435837db /.config | |
parent | 85af48a18caaad43091fa071e3ee06cce4d7accb (diff) | |
download | dotfiles-01fe13624d6a8bb7a7886ac6131edc1dd854b34d.tar.gz dotfiles-01fe13624d6a8bb7a7886ac6131edc1dd854b34d.tar.bz2 dotfiles-01fe13624d6a8bb7a7886ac6131edc1dd854b34d.zip |
add wscan function for parsing iw output
Diffstat (limited to '.config')
-rw-r--r-- | .config/bash/functions.sh | 7 |
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" +} |