The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 10-09-2008
jagnikam jagnikam is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 56
####################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..