about 'expect'
From: Bing Du (bing-du_at_tamu.edu)
Date: 08/26/03
- Next message: Chris Mattern: "Re: Tar backups creating secure tape image?"
- Previous message: Marc David Ronell: "Tar backups creating secure tape image?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Chris Mattern: "Re: Tar backups creating secure tape image?"
- Previous message: Marc David Ronell: "Tar backups creating secure tape image?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|