Skip to content

Instantly share code, notes, and snippets.

@stigok
Created May 27, 2016 03:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stigok/f5cb967d49eb49c931923f8e583d7a6b to your computer and use it in GitHub Desktop.
Save stigok/f5cb967d49eb49c931923f8e583d7a6b to your computer and use it in GitHub Desktop.
Which pacman package supplies this binary
#!/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
@stigok
Copy link
Author

stigok commented May 27, 2016

Install: Add to $PATH
Usage: whothis bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment