Created
August 23, 2014 12:40
-
-
Save przemoc/a6a2bf05e112910be944 to your computer and use it in GitHub Desktop.
[Arch] List provisions with packages providing them
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
# [Arch] List provisions with packages providing them | |
# pacman-based solution | |
pacman -Si \ | |
| awk '/^$/{n=""}/^Name/{n=$3}/^Provides/{if($3!="None"){for(i=3;i<=NF;i++){if(t[$i]=="")t[$i]="";t[$i]=t[$i]" "n}}}END{for(p in t)printf("%44-s :%s\n",p,t[p])}' \ | |
| sort | less | |
# expac-based solution (better) | |
expac -S "%n %P" \ | |
| awk 'NF>1{for(i=2;i<=NF;i++){if(t[$i]=="")t[$i]="";t[$i]=t[$i]" "$1}}END{for(p in t)printf("%44-s :%s\n",p,t[p])}' \ | |
| sort | less |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment