Skip to main content

Thread: expect in a useful way?


so wondering. expect designed do? specifics please.

have no problems it, logging remote system, or downloading files remote site.
when try edit on remote system, creating file. nothing.

example note $amount equals decimal value no colons or anything.
code:
/usr/bin/expect - << endmark  set timeout 1  exp_internal 1  spawn /usr/bin/ssh -f root@ip "/bin/ls /path/ |/bin/grep x_ |/usr/bin/head -n $amount > /path/test"  sleep 1  expect "root@ip's password:"  sleep 1  send "password\r"  sleep 1  endmark
but docent create file @ remote site.
output get

code:
spawn /usr/bin/ssh -f root@ip /bin/ls /path/ |/bin/grep x_ |/usr/bin/head -n 5 > /path/test  parent: waiting sync byte  parent: telling child go ahead  parent: unsynchronized child  spawn: returns {4060}    expect: "" (spawn_id exp4) match glob pattern "root@ip's password:"? no  root@ip's password:   expect: "root@ip's password: " (spawn_id exp4) match glob pattern "root@ip's password:"? yes  expect: set expect_out(0,string) "root@ip's password:"  expect: set expect_out(spawn_id) "exp4"  expect: set expect_out(buffer) "root@ip's password:"  send: sending "password\r" { exp4 }
why cant run commands in expect can run hand?
up-to-date useful expect guides?

kind regards.

i don't have experience this, looks trying match blank object "" (i don't know coming from) form.


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk expect in a useful way?


Ubuntu

Comments

Popular posts from this blog

Falang and too many redirects - Joomla! Forum - community, help and support

Infinite loop detected in JErrorInfinite loop detected in JError - Joomla! Forum - community, help and support

logged out from joomla! - Joomla! Forum - community, help and support