Uwe Klein wrote:
> Andrew Falanga wrote:
>> Hi,
>>
>> This one is a simple one but I'm an expect neophyte. I want to use
>> expect to make a remote system execute some commands using ssh. So,
>> my command looks like this:
>>
>> eval spawn ssh user@host "cmd1; cmd2; cmd3"
>
> on what platform ?
>
>
> this works for me without a hitch:
>
> spawn ssh uwe@otherhost "dir ; ps ; uptime"
> expect
> <res = "Password: ">
>
> exp_send "somepassword\r"
> expect
> <res = lots of output including filelistings,
> processlistings and uptime statistics>
>
>
>
Sorry for taking this long to respond. I had other things suddenly come
up that made this little project "meaningless" for the time being. Now
I'm looking into it again.
In your example, what does the <res = "Password: "> exactly mean? I'm
very familiar with TCL but I've not see that before. Are you refering
to something like "psuedo" code or using some sort of short hand to
explain something or does the expect command use syntax of
<res = "Password: ">
Please explain what is meant by this code.
Thanks
---------------------------------------------
Andrew R. Falanga (a non-HP employee)
Hewlett-Packard Company
11311 Chinden Blvd.
Boise, Idaho
---------------------------------------------
Please note: The e-mail address is purposely
mangled. I do not wish my account at HP to
become a spam haven. If you wish to e-mail
me, the address consists of a dot between
my first and last names (excluding my middle
initial). The rest is accurate. Also, note,
responses must be within the given context of
messages I've posted to usenet. If it's not,
I WILL NOT RESPOND!
Received on Fri Dec 23 18:59:11 2005