bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

can't pass a response from bash script to an app's interactive dialog


From: snowcrash+bugbash
Subject: can't pass a response from bash script to an app's interactive dialog
Date: Thu, 25 Jan 2007 15:45:50 -0800

i'm attempting to write a bash script to automate a sublaunched apps'
interactive dialog.

fwiw, the app in question is gpg, in its key-revocation mode.

the 1st, simple task is to auto-respond to its 1st interactive
question with a 'Yes'; subsequent questions -- there are several --
will require different answers.

my bash script,

% vi test.sh

 ------------------------------------
 #!/usr/local/bin/bash
 GPG="sudo -u me /usr/local/bin/gpg"
 ME="me@mydomain.com"

 CMD="$GPG --output revoke.txt --gen-revoke $ME"

 /usr/bin/expect -c "\
 spawn `$CMD`;\
 stty -echo;\
 expect 'Create a revocation certificate for this key? (y/N) ';\
 send 'y\n'"
 ------------------------------------

@,

        % ./test.sh

correctly launch GPG, and invokes its key revocation session,

 -----------------------------
 sec  1024D/XXXXXXXX 2004-07-07 Me (Me) <me@mydomain.com>

 Create a revocation certificate for this key? (y/N)
 -----------------------------

but it just _sits_ there. no response is passed/accepted. :-/

i've tried playing with piping 'cat ... |' and 'echo ... |', as well
as 'yes y | ...', all with no luck.

how do i get that 'yes' response passed to gpg?

thanks.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]