[Gllug] Help with Script.

Jason Clifford jason at ukfsn.org
Mon Jan 10 15:39:16 UTC 2011


On Mon, 2011-01-10 at 15:24 +0000, Martin N Stevens wrote:
> I am trying to write a script that will collect all the mac addresses
> on my network, it will be run periodically to update a file called
> mac.txt
> 
> However the matching part doesn't seem to be working. Any clues please.

Which matching part?

> nmap 10.72.92.0/22 -sP | grep MAC | cut -d " " -f3 > live.txt

The "cut" part needs to be :

cut -d " " -f3 - >> live.txt

as the file is STDIN and out want to append to live.txt rather than
overwriting it completely with each match.


-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list