Tuesday, January 8, 2013

good times with system inventories

i heart lists. i really do.

i have lots and lots of lists. sometimes people send me lists asking me to do things with things on lists. one of my favorite sorts of lists is an inventory list. i like to know what i have.

one day, say today, someone asked me to turn off a scad of systems that were on a list. it was a long list. but some things on the to-be-turned-off list were not on my list. how do i figure out what is mine or not?

sort and awk are my friends.
sort mysystems.txt maybemysytstems.txt | awk 'seen[$0]++ == 1' > systemsonbothlists.txt
and there you go.

No comments: