Skip to content

Instantly share code, notes, and snippets.

@stigok
Created May 27, 2016 03:47
Show Gist options
  • Select an option

  • Save stigok/f5cb967d49eb49c931923f8e583d7a6b to your computer and use it in GitHub Desktop.

Select an option

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

stigok commented May 27, 2016

Copy link
Copy Markdown
Author

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