On branch parse-mdls

Your branch is up to date with 'origin/parse-mdls'.

 Changes to be committed:
modified:   hash-files
	Added default keys_of_interest array
	Added output filter functionality leveraging keys_of_interest
parse-mdls
Mike Holloway 2 years ago
parent 8a9f48481f
commit fc2dae9e56
  1. 7
      hash-files

@ -1,5 +1,6 @@
#!/usr/bin/env bash
log_file=/var/log/hash-files.log
keys_of_interest={"kMDItemFSCreationDate" "kMDItemFSName"}
md5_bin=$(which md5sum)
mktemp_bin=$(which mktemp)
DateTimeStamp=$(date +\%D_\%T)
@ -36,7 +37,11 @@ mdls_files () {
for line in $(mdls $file); do
mdls_key=$(printf "%s" $line | cut -d '=' -f 1)
mdls_value=$(printf "%s" $line | cut -d '=' -f 2)
printf "\n============================\nMDLS Key: %s\nMDLS Value: %s\n============================\n\n" $mdls_key $mdls_value
if $(grep $mdls_key $keys_of_interest);then
printf "\n============================\nMDLS Key: %s\nMDLS Value: %s\n============================\n\n" $mdls_key $mdls_value
else
:
fi
done
done

Loading…
Cancel
Save