TL; DR
cat gpg_private_key | gpg --import --allow-secret --no-tty --batch --yes
環境
Windows10 1903 Ubuntu 18.04.3 GnuPG 2.2.4
なにがおきたか
keybaseの鍵をimportしようとしたところ、public keyはimportできるがprivate keyがimportできなかった。
$ cat a | gpg --import --allow-secret gpg: key 643A6046F73AD552: "Suzuka Asagiri (keybase) <admin@suzutan.jp>" not changed gpg: key 643A6046F73AD552/643A6046F73AD552: error sending to agent: Inappropriate ioctl for device gpg: key 643A6046F73AD552/4782FD1BCB42FC2A: error sending to agent: Inappropriate ioctl for device gpg: key 643A6046F73AD552/04379B31ECD0CD77: error sending to agent: Inappropriate ioctl for device gpg: key 643A6046F73AD552/57F659953D45B6C6: error sending to agent: Inappropriate ioctl for device
--no-tty --batch --yes
をつけてimportを行ったら問題なくimportが完了した。