Re: Problems with expect and scp



On Jun 13, 3:23 am, "Esa Heikkinen" <esa.heikki...@xxxxxxxx> wrote:
Hi

I have problems with expect (5.43) and scp (Cygwin) in Windows NT.
With ssh (Cygwin) there are no problems and it works very well.

If i give my scp-command (scp l...@xxxxxxx:/home/login/log/* .) "by hand"
(in Cygwin), it works very well.
(login and IP-address has been changed.)

My script:
spawn scp l...@xxxxxxx:/home/login/* .
expect "password:"
send "password\r"

Following error message was generated:
"write(spawn_id=1]: broken pipe"

Why ssh works with expect, but scp does not ?

---
Esa

I know on my system that the shell will expand the * to a filename so
I have to get
the files like so
scp chuck@chimpy:/home/chuck/"*" .
this will prevent the scp from expanding the * to a file and screwing
up the command
Now when you do this in expect , tcl does not do shell expansion so
you are trying to
transfer a file named * not all files in the directory. Since it
cannot find file * it dies
you need to do this:

spawn scp l...@xxxxxxx:/home/login/log/\"\*\" .


Carl

.



Relevant Pages

  • Re: ssh from Linux to Windows
    ... I'm not sure how to get an ssh server running on Windows, ... Install cygwin on the XP box and then you can scp from your Linux box to ...
    (comp.os.linux.misc)
  • Problems with expect and scp
    ... I have problems with expect and scp (Cygwin) in Windows NT. ... With ssh there are no problems and it works very well. ...
    (comp.lang.tcl)
  • Re: Is SSH worth it??
    ... > We would be using SSH and SCP. ... SCP for automated scripts. ... > client will not be prompted for a password. ... remote machine, but imho it is better to swap client+server and give ...
    (Security-Basics)
  • RE: SCP and MVS data sets?
    ... SCP and MVS data sets? ... Is it possible that the open function is different in SCP? ... You can also do the following weirdness to use ssh to copy a z/OS legacy ...
    (bit.listserv.ibm-main)
  • Re: why does scp not use all my cores on a multi-cpu machine?
    ... When I ran my little test earlier, I observed that while I typed scp, both ... scp and ssh got "energized" and in fact ssh used more time than scp. ... Now since encrypting and transmitting has some elements of paralellity ... Right -- ssh, et. al. is an I/O bound process, so long as the network ...
    (comp.os.linux.misc)