I have the following as the script /usr/local/bin/cygsearch
(with /usr/local/bin
in my $PATH
, obviously)
#!/bin/sh
#
if [ $# -eq 0 ]
then
echo "Usage: ${0##*/} <program_name>" >&2
exit 1
fi
cygcheck -p "/$1"
This version uses an online repository search for the specified file, returning a list of packages where there is a match. For example,
cygsearch date.exe
Found 6 matches for /date.exe
coreutils-debuginfo-8.26-2 - coreutils-debuginfo: Debug info for coreutils
coreutils-debuginfo-8.32-1 - coreutils-debuginfo: Debug info for coreutils
coreutils-debuginfo-9.0-1 - coreutils-debuginfo: Debug info for coreutils
coreutils-8.26-2 - coreutils: GNU core utilities (includes fileutils, sh-utils and textutils)
coreutils-8.32-1 - coreutils: GNU core utilities (includes fileutils, sh-utils and textutils)
coreutils-9.0-1 - coreutils: GNU core utilities (includes fileutils, sh-utils and textutils)
You don't always need to include the .exe
suffix, but without it I find I often get too many false positives for the results I'm expecting