I have output from a specific command that can provide the number of times an application has been marked as 'used' on an OS X system. The command is mdls
.
The output looks similar to the following (truncated)
...
kMDItemLastUsedDate = 2016-03-15 18:45:00 +0000
kMDItemLogicalSize = 47225668
kMDItemPhysicalSize = 57065472
kMDItemUseCount = 90
kMDItemUsedDates = (
"2016-02-02 06:00:00 +0000",
"2016-02-03 06:00:00 +0000",
"2016-02-04 06:00:00 +0000",
"2016-02-05 06:00:00 +0000",
"2016-02-09 06:00:00 +0000",
"2016-02-10 06:00:00 +0000",
"2016-02-11 06:00:00 +0000",
"2016-02-12 06:00:00 +0000",
"2016-02-13 06:00:00 +0000",
"2016-02-14 06:00:00 +0000",
"2016-02-15 06:00:00 +0000",
"2016-02-16 06:00:00 +0000",
"2016-02-17 06:00:00 +0000",
"2016-02-18 06:00:00 +0000",
"2016-02-19 06:00:00 +0000",
"2016-02-20 06:00:00 +0000",
"2016-02-21 06:00:00 +0000",
"2016-02-22 06:00:00 +0000",
"2016-02-23 06:00:00 +0000",
"2016-02-24 06:00:00 +0000",
"2016-02-25 06:00:00 +0000",
"2016-02-26 06:00:00 +0000",
"2016-02-27 06:00:00 +0000",
"2016-03-02 06:00:00 +0000",
"2016-03-05 06:00:00 +0000",
"2016-03-07 06:00:00 +0000",
"2016-03-09 06:00:00 +0000",
"2016-03-10 06:00:00 +0000",
"2016-03-11 06:00:00 +0000",
"2016-03-12 06:00:00 +0000",
"2016-03-13 06:00:00 +0000",
"2016-03-15 05:00:00 +0000"
)
kMDItemVersion = "9.0.3"
...
Of this list of stuff, I really only want to view the specific entries related to kMDItemUsedDates
. I don't know how many lines this entry may have on any given system, it could be 1 or it could be 32.
How would I process this output to be able to retrieve ONLY a count of the number of date-stamp entries pertaining to the kMDItemUsedDates
array? It's important to note that date-stamps in and of themselves are not unique in this command output.