|
####################my_shell_script.exp #################
#!/usr/bin/expect -f
exp_internal 1
spawn /usr/bin/scp -i /root/Test/abcds test.txt root@192.168.1.6:/tmp/
expect "*?assword:*"
send "pass_word\r"
send -- "\r"
expect eof
###################Output ###########################
spawn /usr/bin/scp -i /root/Test/abcds test.txt root@192.168.1.6:/tmp/
parent: waiting for sync byte
parent: telling child to go ahead
parent: now unsynchronized from child
spawn: returns {4384}
expect: does "" (spawn_id exp7) match glob pattern "*?assword:*"? no
expect: timed out
send: sending "pass_word\r" to { exp7 }
send: sending "\r" to { exp7 }
pass_word
expect: timed out
can anybody guide me whats wrong in this script ?
Thanks In Advance
Last edited by jagnikam; 10-10-2008 at 05:06 PM..
|