From 01fe13624d6a8bb7a7886ac6131edc1dd854b34d Mon Sep 17 00:00:00 2001 From: ben Date: Thu, 14 Oct 2010 19:39:24 +0200 Subject: add wscan function for parsing iw output --- .config/bash/functions.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to '.config/bash') 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" +} -- cgit