- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Expect script error--help needed
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2009 07:29 AM
тАО06-29-2009 07:29 AM
Expect script error--help needed
I have the following expect script for doing sftp. I need to use only expect. Please see the script and error below.
#!/opt/expect/expect
set file [lindex $argv 4]
set directory [lindex $argv 5]
set action [lindex $argv 6]
set timeout 360
spawn /usr/local/bin/sftp2 $user@$server$port
expect "$user@$server's password"
send "$pword\r"
expect "sftp>"
send "cd $directory\r"
expect "sftp>"
send "$action $file\r"
expect "sftp>"
send "quit\r"
exit
Error:
send: spawn id exp4 not open
while executing
"send "quit\r""
Thanks in advance.
- Tags:
- expect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2009 07:36 AM
тАО06-29-2009 07:36 AM
Re: Expect script error--help needed
I know this is not the answer you seek but you don't need expect to automate sftp.
You can use scp after public key exchange.
Link.
http://www.hpux.ws/?p=10
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2009 07:53 AM
тАО06-29-2009 07:53 AM
Re: Expect script error--help needed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2009 12:40 PM
тАО06-29-2009 12:40 PM
Re: Expect script error--help needed
The @ symbol might be killing the input. take a look at the output of "stty -a". you might have to escape it.
and here:
expect "$user@$server's password"
i'd use
expect "password"
i don't think you're really getting logged it to begin with
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2009 02:43 AM
тАО07-06-2009 02:43 AM
Re: Expect script error--help needed
http://coding.derkeiler.com/Archive/Tcl/comp.lang.tcl/2005-03/1589.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2009 07:30 AM
тАО07-07-2009 07:30 AM