[ale] Fwd: Re: [ale] i just don't "get" it yet GOT IT
Charles Shapiro
charles.shapiro at nubridges.com
Wed Apr 17 07:54:16 EDT 2002
I've had good luck using expect(1) for things like this. I'm not sure it
is installed by default on your distro, but the rpm is on the
distributed RedHat CD at least as far back as 6.2. The Debian Potato
distro also carries a .deb file which you can install with dselect. It's
a full-fledged programming language written to control things like
telnet(1), ftp(1), and other stuff where you need to simulate a user
sitting at a keyboard. For example, I ssh(1) to developmment boxen here
from an icon on my desktop with the script:
#!/usr/bin/expect
spawn ssh -l cshapiro $argv
expect "password:"
send "my_secret_password_which_isnt_this\r"
interact
So for your automated thing it'd be something like
#!/usr/bin/expect
spawn ftp remote.system
expect "ername:"
send "username\r"
expect "ssword:"
send "password\r"
send "get /home/rk4com/CLbackup.tgz /data/foo\r"
expect "226"
et cetera and so forth. Expect has all kinds of timeout and error
checking stuff which I haven't put into this example; you can, of
course, make your script as complex and wonderful (or simple and robust)
as you wish.
-- CHS
On Tue, 2002-04-16 at 20:42, ChangingLINKS.com wrote:
> Subject: Re: [ale] i just don't "get" it yet GOT IT
> Date: Tue, 16 Apr 2002 20:40:05 -0400
> From: "ChangingLINKS.com" <ChangingLINKS.com at bigfoot.com>
> To: <hirsch at zapmedia.com>, x3 at changinglinks.com
<<snip>>
>
> Thank you all for your help on this. Now in a "but wait, it gets worse"
> fashion: Is there anyway to make this a .sh script that I can click on? How
> does the sh script know to wait for the file to get tarred and transfered
> before deleteing the file (there is a time delay)?
<<snip>>
---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be
sent to listmaster at ale dot org.
More information about the Ale
mailing list