hi there,
im writing some scripts in awk; in few words i have a list from router (mac address- ip address) and the second list with only the mac addresses.
the thing is that i want search list from router for the first mac address; if found - print the ip address, if not print error; then search the router list for the second mac address, if found print ip.. etc.
summarize: i have two files, router and macs like this (respectivly)
43:43:43:43:43 10.0.0.3
43:43:43:43:45 10.0.0.4
43:43:43:43:44 10.0.0.5
43:43:43:43:46 10.0.0.6
and
43:43:43:43:43
43:43:43:43:46
and as result im looking for:
43:43:43:43:43 10.0.0.3
43:43:43:43:46 10.0.0.6
im doing it in this way:
cat router | awk '{
getline tmp < macs
if ($1 = tmp) print
}'
i know, it is wrong, that is why im posting
any ideas?
cheers.
im writing some scripts in awk; in few words i have a list from router (mac address- ip address) and the second list with only the mac addresses.
the thing is that i want search list from router for the first mac address; if found - print the ip address, if not print error; then search the router list for the second mac address, if found print ip.. etc.
summarize: i have two files, router and macs like this (respectivly)
43:43:43:43:43 10.0.0.3
43:43:43:43:45 10.0.0.4
43:43:43:43:44 10.0.0.5
43:43:43:43:46 10.0.0.6
and
43:43:43:43:43
43:43:43:43:46
and as result im looking for:
43:43:43:43:43 10.0.0.3
43:43:43:43:46 10.0.0.6
im doing it in this way:
cat router | awk '{
getline tmp < macs
if ($1 = tmp) print
}'
i know, it is wrong, that is why im posting
any ideas?
cheers.