Skip to content

Instantly share code, notes, and snippets.

@ejel

ejel/gist:1077064

Created Jul 11, 2011
Embed
What would you like to do?
Eject connected external devices
#!/usr/bin/env zsh
for d in /Volumes/*
do
if diskutil info $d | grep -P "\bEjectable:\s+Yes" > /dev/null
then
diskutil eject $d
fi
done
growlnotify -m "External devices ejected."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment