Comments on How to get a mailto: URI out of abook(1)
Post
How to get a mailto: URI out of abook(1)
+0
−0
I store my address book with abook(1).
https://manpages.debian.org/bookworm/abook/abook.1.en.html
Let's say I want to introduce some contact in some field that accepts the usual name <email>
format.
How can I ask abook(1) to produce that format?
The addressbook entry is the following:
[0]
name=Alejandro Colomar
email=alx@kernel.org,alx.manpages@gmail.com
nick=alx
(I hope it's a valid one.)
With --mutt-query, I can get something similar:
$ abook --mutt-query alx
alx@kernel.org Alejandro Colomar
alx.manpages@gmail.com Alejandro Colomar
Then, I can do some magic with custom formats, but I get a wrong email:
$ abook --mutt-query=alx --outformat=vcard \
| abook --convert --infile=- --informat=vcard \
--outformat=custom --outformatstr='{name} <{email}>';
Alejandro Colomar <alx@kernel.org,alx.manpages@gmail.com>
The above pipeline works only for contacts with a single email. Is there a way to make it work for every contact?
EDIT:
This is what I'd expect:
$ abook --mutt-query=alx --outformat=mailto
Alejandro Colomar <alx@kernel.org>
Alejandro Colomar <alx.manpages@gmail.com>
2 comment threads