--- nmbscan.orig 2005-09-21 22:10:05.223491664 +0200 +++ nmbscan 2005-09-21 22:11:59.215162296 +0200 @@ -376,7 +376,7 @@ function get_server_and_os_by_ip { - V=$(smbclient -L ${2:-$1} -I $1 -U % 2>&1 | grep '^Domain'| sed 's#.*OS=\[\(.*\)\].*Server=\[\(.*\)\].*#\2/\1#' | head -1) + V=$(smbclient -L ${2:-$1} -I $1 -U % 2>&1 | grep '^Domain'| sed 's#.*OS=\[\(.*\)\].*Server=\[\(.*\)\].*#\2/\1#' | head -n 1) echo ${V:--/-} } @@ -424,13 +424,13 @@ function get_nmbname { - V=$(nmblookup -A $1 2>&1 | grep "<20>" | head -1 | awk '{print $1}') + V=$(nmblookup -A $1 2>&1 | grep "<20>" | head -n 1 | awk '{print $1}') echo ${V:--} } function get_domain { - V=$(nmblookup -A $1 2>&1 | grep "<1e>" | head -1 | awk '{print $1}') + V=$(nmblookup -A $1 2>&1 | grep "<1e>" | head -n 1 | awk '{print $1}') echo ${V:--} }