bug-bash
[Top][All Lists]
Advanced

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

Re: can't pass a response from bash script to an app's interactive dialo


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

i wasn't even close! but, this works:

-----------------------------------------
#!/usr/local/bin/bash
$GPG="sudo -u gpguser /usr/local/bin/gpg
$NAME="revoke.txt"
$ADDR="address@hidden"

VAR=$(expect -c "
        spawn $GPG --output $NAME --gen-revoke $ADDR
        set timeout -1
        stty -echo
        expect \"Create a revocation certificate for this key? (y/N) \"
        send   \"y\n\"
        expect \"Your decision? \"
        send   \"0\n\"
        expect \"\> \"
        send   \"\n\"
        expect \"Is this okay? (y/N) \"
        send   \"y\n\"
        expect \"Enter passphrase: \"
        send   \"$PASS\r\"
        expect exp_continue
")
echo "$VAR"
-----------------------------------------

hth someone else.




reply via email to

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