I need it to either not add the time stamp if the awk finds a duplicate or write over the time with the new time if awk finds a duplicate.

BTW this is all pretty much cut-and-paste scripting so please feel free to comment if you know a more elegant way.

grail

11-21-2010 12:37 AM

What is in database? Or is it created via touch each time it is run?

Also, why is the time stamp (better use date function by the way) on its own line above the mac address?
Normally you would see it in the same line.

Also, as the data would appear to only contain this information, why are the colons (:) being removed?

My general suggestion would be to change all of your output files to variables.

sociopathichaze

11-21-2010 02:15 AM

Quote:

What is in database? Or is it created via touch each time it is run?

Also, why is the time stamp (better use date function by the way) on its own line above the mac address?
Normally you would see it in the same line.

Also, as the data would appear to only contain this information, why are the colons ( being removed?

My general suggestion would be to change all of your output files to variables.

The database file is just a file stored on the usb drive that can later be imported into another program. This is going to be run on a couple hundred machines, each time adding to the file.

The timestamp is on its own line because if it was on the same line as the info, the awk command wouldn't see it as a duplicate because the time is different.

The colons are removed because the program that the database will be read by only reads macs without colons.

My output files are files and not variables because when they are created and deleted, they are written to the usb which make the light flicker, which is useful because the computers aren't going to have monitors hooked up to them. Kind of a ghetto progress bar.