Hello, If issuing the commands manually produces the desired output, you could try autoexpect¹ and edit the output of running an autoexpect session to your liking. There is a manual page too².
Hope it helps. Regards. ¹http://expect.nist.gov/example/autoexpect ²http://expect.nist.gov/example/autoexpect.man.html -- Huella de clave primaria: 0FDA C36F F110 54F4 D42B D0EB 617D 396C 448B 31EB
pgp0pjvuZiGkp.pgp
Description: PGP signature