To clear things up I have setup folder actions on my mac for whenever a USB device is plugged into my mac it will run a shell script.
When I list all files in the Directory /Volumes i get
$ ls -a
. .. .DS_Store MobileBackups Storage WED
What I want to do is list all folders and files located in WED or any USB that pops up, so therefore excluding the directories
. .. .DS_Store MobileBackups Storage
Leaving me with
WED
What i have for the script so far is:
GLOBIGNORE='/Volumes/MobileBackups*':'/Volumes/Storage*'
find '/Volumes' >> /Users/Brett/dev/USBLOGS/LogUSB.txt
I have tried multiple different ways but it still ends up listing every single file in the /Volumes directory.
Any help would be greatly appreciated. Thanks, Brett
Additionally, it is MAC OS X El Capitan
grep
once and as now written it can return just the fully qualified pathname(s) of the mounted USB block device(s) from the output of System Profiler in onegrep
process (per mounded USB block device). I guess I was too tired to see it last night. :)