Home > Archive > Tcl > June 2007 > Problems with expect and scp
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Problems with expect and scp
|
|
| Esa Heikkinen 2007-06-13, 8:09 am |
| 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 login@1.1.1.1:/home/login/log/* .) "by hand"
(in Cygwin), it works very well.
(login and IP-address has been changed.)
My script:
spawn scp login@1.1.1.1:/home/login/log/* .
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
| |
| Bezoar 2007-06-21, 7:13 pm |
| On Jun 13, 3:23 am, "Esa Heikkinen" <esa.heikki...@insta.fi> 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...@1.1.1.1:/home/login/log/* .) "by hand"
> (in Cygwin), it works very well.
> (login and IP-address has been changed.)
>
> My script:
> spawn scp l...@1.1.1.1:/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...@1.1.1.1:/home/login/log/\"\*\" .
Carl
| |
|
|
| esa.heikkinen@insta.fi 2007-06-25, 10:10 pm |
| On 21 kes=E4, 23:16, Bezoar <cwjo...@gmail.com> wrote:
> On Jun 13, 3:23 am, "Esa Heikkinen" <esa.heikki...@insta.fi> wrote:
>
>
> spawnscpl...@1.1.1.1:/home/login/log/\"\*\" .
>
> Carl-
Hi
This does not work :(
Even if give command "spawn C:\\cygwin\\bin\\scp login@1.1.1.1:/home/
login/log/file.txt" this does not work.
Same error is occured.
---
Esa
|
|
|
|
|