<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#333333">
<br>
<div class="moz-cite-prefix">On 12/18/19 10:56 , Andrew Gallagher
wrote:<br>
</div>
<blockquote
cite="mid:bd02d9ef-0de0-81ed-88cf-ad2dc6df08c2@andrewg.com"
type="cite">
<pre wrap="">On 18/12/2019 09:32, Werner Koch via Gnupg-users wrote:
</pre>
<blockquote type="cite">
<pre wrap="">The -F:::::: is an interesting hack but Andrew's or my variant works
with all AWK implementations:
awk -F: '$1=="fpr" {print $10}' | head -1
</pre>
</blockquote>
<pre wrap="">
Aha, I forgot about handling multiple results. Note that you don't need
head if you're already using awk:
awk -F: '$1=="fpr" {print $10; exit}'
:-D
</pre>
</blockquote>
<br>
This was really interesting. Thanks for that tip (all of you). :)<br>
Updated a key the other day, in a more manual way.<br>
<br>
What about updating sub-keys…<br>
<pre><pre>$ gpg --with-colons -k 0xlongid | awk -F: '$1==<font class="pastecode" color="#008B00">"fpr"</font> {print $10}'
0123…
4567…
8901…
2345…
</pre></pre>
Any convenient way to automate that, or can I just loop it?
…something like:<br>
<pre><pre>$ for k in $(gpg --with-colons -k 0xlongid | awk -F: '$1==<font class="pastecode" color="#008B00">"fpr"</font> {print $10}'); do \
> gpg --quick-set-expire ${k} <time>; done
</pre></pre>
<br>
· Eric<br>
</body>
</html>