Created
May 27, 2016 03:47
-
-
Save stigok/f5cb967d49eb49c931923f8e583d7a6b to your computer and use it in GitHub Desktop.
Which pacman package supplies this binary
This file contains hidden or 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/env bash | |
echo "Who this :) <21" | |
if [ "$1" = "" ]; then | |
echo "Missing arg" | |
exit 1 | |
fi | |
filepath=$(which $1 2> /dev/null) | |
if [ $? -gt 0 ]; then | |
echo "'$1' not found in path" | |
exit 1 | |
fi | |
pacman -Qo "$filepath" 2> /dev/null | |
if [ $? -gt 0 ]; then | |
echo "No package supplies $1" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Install: Add to $PATH
Usage:
whothis bash