summaryrefslogtreecommitdiffstats
path: root/mutt-search-address-book
blob: bc5352aac90434d70544df4513d64feebea58a92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash

pattern=$1

echo 'searching for '$pattern' ...'

get_matches() {
	gpg --list-keys --with-colons | grep '^uid:' | cut -d: -f10 | sed -rn 's#(.*) <([^>]+).*#\2\t\1\tgpg-mail#p' | grep -F "$pattern"
	khard email --parsable --remove-first-line --search-in-source-files "$pattern"
}

get_matches | sort -u