Hi
I am not sure how to ask this.
$NMBSCAN has the following info pigeonholed into it:
Code:
nmbscan version 1.2.5
domain MSHOME
master-browser MOM 192.168.2.98 -
server MOM
ip-address 192.168.2.98
mac-address
server-software Windows 2000 LAN Manager
operating-system Windows 5.1
What I am trying to do is filter the results of one variable and put it into another variable. Namely, I am trying to obtain the server name and ip address. I tried a bunch of different variations but nothing seems to work.
Here are a few of variations that
do not produce the results that I am looking for.
Code:
SETARRAY=$[ echo "$NMBSCAN | grep -B1 'ip-address' | awk '{print $2}'"]
Code:
SETARRAY=$[$NMBSCAN | grep -B1 'ip-address' | awk '{print $2}']
Code:
SETARRAY=( $NMBSCAN | grep -B1 'ip-address' | awk '{print $2}' )
I am not sure what is wrong with my syntax. Any suggestions?