[Dev-sig] expect is quite nice

Robert Leyva mrflash818 at geophile.net
Mon Sep 11 22:29:23 PDT 2006


I wanted to make a script that would auto fetch from cvs for me.

I had already written a fetchFromCVS.sh, but get prompted for a password.

Since I am a debian user, the solution was as simple as downloading
"expect" and creating a new script to wrap the old one:

robert at pip ~ sudo aptitude install expect

then the very simple script that gives a newline when the cvs program asks
for a password...

robert at pip ~/projects/clamav cat ./autoFetchFromCVS.sh
#!/usr/bin/expect -f

spawn ./fetchFromCVS.sh
expect "assword"
send "\n"
expect eof

robert at pip ~/projects/clamav


-- 
"Knowledge is Power" -- Francis Bacon

Robert Leyva
mrflash818 at geophile.net



More information about the Dev-sig mailing list