Expect or sftp question ?
From: newexpectuser (anthonypieper_at_cs.com)
Date: 10/28/03
- Next message: David Gravereaux: "Re: Expect or sftp question ?"
- Previous message: lvirden_at_yahoo.com: "Re: statically linked precompiled expect binary for solaris"
- Next in thread: David Gravereaux: "Re: Expect or sftp question ?"
- Reply: David Gravereaux: "Re: Expect or sftp question ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Oct 2003 05:29:55 -0800
I'm not sure if this falls into an Expect or sftp question, but I am
trying to get some files into the /client/files/in directory.
This script is called from another script. When the line lpwd runs, it
does give me "client/files/in", but my files don't get transfered into
this directory. I've tried to add a sleep command just in case it was
running too fast. It seems the lcd command is not working properly.
#!/usr/bin/expect -f
spawn sftp root@xxx.xxx.xx.xxx
set timeout 180
set FAILED 2
set CDFAILED 3
expect {
timeout {
exit $FAILED
}
"password:" {
send "xxx\r"
}
}
expect "sftp>"
send "cd /customer/mailbox/inbox\r"
expect "sftp>"
send "lcd /client/files/in\r"
sleep 30
expect {
"Couldn't canonicalise: No such file or directory" {
exit $CDFAILED
}
"sftp>" {
send "lpwd\r"
send "mget *.dat\r"
}
}
expect "sftp>"
send "quit\r"
- Next message: David Gravereaux: "Re: Expect or sftp question ?"
- Previous message: lvirden_at_yahoo.com: "Re: statically linked precompiled expect binary for solaris"
- Next in thread: David Gravereaux: "Re: Expect or sftp question ?"
- Reply: David Gravereaux: "Re: Expect or sftp question ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|