about 'expect'

From: Bing Du (bing-du_at_tamu.edu)
Date: 08/26/03


Date: Mon, 25 Aug 2003 17:01:03 -0500


I'm trying to have the following expect script be as generic as possible
  so that it can be used to decrypt different files. However, I'm stuck
on the line 'File \"/data/my.txt\" already exists. Overwrite? \[y/N\]
"'. I tried to replace the specific value with a variable and hope
interpolation to take place, that is some thing like 'File \""$output"\"
already exists. Overwrite? \[y/N\] "', but it does not work.

===================
#!/public/bin/expect -f

set input [lindex $argv 0]
set output [lindex $argv 1]

spawn pgpv -o $output $input

match_max 100000
expect -exact "Message is encrypted.\r
Need a pass phrase to decrypt private key:\r
   1024 bits, Key ID 11111111, Created 2003-07-09\r
    \"datafeed <admin@some.edu>\"\r
Enter pass phrase: "
send -- "xxxxxxx\r"
expect -exact "\r
Pass phrase is good.\r
File \"/data/my.txt\" already exists. Overwrite? \[y/N\] "
send -- "y\r"
expect eof
===================

Thanks in advance for any ideas and suggestions.

Bing



Relevant Pages

  • expect spawn and gpg
    ... I have a expect script which encrypt a tar file with a password. ... set infile [concat $intarfile.tar] ... If I run gpg on command line on the same file of size 1.2GB, ... If I try to use gpg to decrypt the 24MB file, ...
    (comp.lang.tcl)
  • Re: decrypt a vi -x encrypted file ???
    ... In comp.os.linux.misc, Chiefy wrote: ... the script is not executable any more. ... mistakenly "cbw") that can interactively decrypt vi-encrypted files. ... As I recall the curses stuff gave me a couple of problems, ...
    (comp.os.linux.misc)
  • Re: encrypting wsh file
    ... > This is not completely bulletproof. ... > There are plenty of utilities out there to decrypt a script. ...
    (microsoft.public.scripting.wsh)
  • decrypting with gpg via web interface
    ... I have a web interface which calls a scriptin in the back end to decrypt a ... gpg file and perform some other actions, I have all the keys install on this ... server as root and when I execute the script as root all works fine. ... The web page calls a shell script which is run the command with sudo to ...
    (alt.linux)
  • Re: Encrypt with RijndaelManaged and decrypt with OpenSSL
    ... This is a point that I'm a bit stuck on...because the devices have ... to decrypt the file, and I can only give them the key. ... tool that allows me to encrypt the files. ... I've seen some references that seem to indicate the the IV may be ...
    (microsoft.public.dotnet.security)