Last active
December 10, 2015 17:28
-
-
Save m2ym/4467511 to your computer and use it in GitHub Desktop.
dpkg-readme helps you to quickly open README.Debian of given package
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/sh | |
: ${PAGER:=cat} | |
package="$1" | |
readme="$(dpkg-query -L "$package" 2> /dev/null | grep README.Debian | head -n 1)" | |
if [ -s "$readme" ]; then | |
case "$readme" in | |
*.gz) gunzip -qc "$readme" | $PAGER;; | |
*) $PAGER "$readme";; | |
esac | |
else | |
echo "$package: README.Debian not found" >&2 | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment