Thanks sherwin! i think i tried this one but apparently, i missed something.
thanks.

--
glenn

Sherwin Daganato wrote:
On Tue, Oct 14, 2003 at 06:04:46PM +0800, Glenn Remot wrote:
  
sed -n 's/128/#/p' /root/x | awk -F'#' '{ print $2 }' | awk '{ print $1 
}' | sed -n 's/./128./p' | grep -m 1 128.1 | nmblookup -A
    

Glenn,

The ip address should be passed as argument; not fed to STDIN.

It should be:

(using backticks)
nmblookup -A `sed -n 's/128/#/p' /root/x | awk -F'#' '{ print $2 }' | 
awk '{ print $1 }' | sed -n 's/./128./p' | grep -m 1 128.1`

or

nmblookup -A $(sed -n 's/128/#/p' /root/x | awk -F'#' '{ print $2 }' | 
awk '{ print $1 }' | sed -n 's/./128./p' | grep -m 1 128.1)

or

sed -n 's/128/#/p' /root/x | awk -F'#' '{ print $2 }' | 
awk '{ print $1 }' | sed -n 's/./128./p' | grep -m 1 128.1 |
xargs nmblookup -A


Also, grep -m 1 128.1 will match 128F1. You may change this to
grep -m 1 128\\.1 or grep -m 1 '128\.1'

HTH
  

-- 
Glenn Remot
Network Engr. - IT,Network Comm. Section,
The Philippine Daily Inquirer
8978808 loc 351
--
Philippine Linux Users' Group (PLUG) Mailing List
[EMAIL PROTECTED] (#PLUG @ irc.free.net.ph)
Official Website: http://plug.linux.org.ph
Searchable Archives: http://marc.free.net.ph
.
To leave, go to http://lists.q-linux.com/mailman/listinfo/plug
.
Are you a Linux newbie? To join the newbie list, go to
http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie

Reply via email to