Created
March 2, 2014 14:27
-
-
Save wenkokke/9307348 to your computer and use it in GitHub Desktop.
Small bash script that determines by which packages a Brew package is used.
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
#!/bin/bash | |
if [[ -z "$1" ]]; then | |
echo "usage: witch [package name]" | |
else | |
# iterate over all installed packages | |
for pkg in $( brew list ); do | |
# iterate over all their dependencies | |
for dep in $( brew deps $pkg ); do | |
if [ "$dep" == "$1" ]; then | |
echo "$pkg" | |
fi | |
done | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment