The following script takes a user input (path to a mounted macOS volume such as /Volumes/Macintosh\ HD/)
#!/bin/bash # Author: Swasti Bhushan Deb # macOS 10.13.3 # kMDItemWhereFroms.sh read -e -p "Enter the full path to the Mounted Volume (e.g /Volume /Macintosh HD): " path var=$(mdfind -name 'kMDItemWhereFroms="*"' -onlyin "$path") echo "$var"
/Users/swastibhushandeb/Documents/encase_examiner_v710_release_notes.pdf /Users/swastibhushandeb/Desktop/AirPrint Forensics.pdf
As a next step I would like the script to perform
mdls (prints the values of all the metadata attributes associated with the files) on each output from kMDItemWhereFroms.sh,which can also be perfromed manually by:
However if such processing is to be automated,what are the available bash coding strategies/options available?How can the output be directed to a csv file so that each column contains fields from
mdls command output?