Created
May 10, 2014 09:45
-
-
Save smw/e7202b2dc40abab792ba to your computer and use it in GitHub Desktop.
A reasonable approximation of Everything Search's command line interface, es.exe, under OS X.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
if (@ARGV < 1) { | |
print "Usage: es <file glob to search for>\n"; | |
exit(1); | |
} | |
my $nameGlob = shift @ARGV; | |
exec ('mdfind', qq(kMDItemDisplayName=='${nameGlob}'c), @ARGV) or | |
print $STDERR "Couldn't find mdfind: $!"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment