Gnupg2 uses --fixed-list-mode by default for --with-colons.
Gnupg1 needs this option explicitly to generate the same output
format (timestamps) for expiry dates.
Thanks to Jan Unterbrink for reporting the bug.
userid="`mhparam pgpkey`"
fi
if [ -z "$userid" ] ; then
- userid="`gpg --list-secret-keys --with-colons 2>/dev/null |
+ userid="`gpg --list-secret-keys --with-colons --fixed-list-mode \
+ 2>/dev/null |
grep '^sec' | sort -t: -k3,3nr -k 6,6nr |
awk -F: '
- $7=="" || $7 > "'"\`date +%Y-%m-%d\`"'" {
+ $7=="" || $7 > "'"\`date +%s\`"'" {
print $5; exit;
}
'`"