Issue while using expect script in bash script -


i learned same site can embed expect script in bash script shown below:

echo $hostname /usr/bin/expect -<<eod spawn ssh "-o stricthostkeychecking no " bmaddi@10.102.238.158 sleep 5 expect "$*"     send -- "scp \"-o stricthostkeychecking no\"  file user@hostname: \r"     expect "$*"     send -- "exit \r" expect eof eod 

when trying execute above script logs on host , stuff on there , come original host, facing following error:

invalid command name "eod" while executing "eod " . not recognizing eod end of usage of expect script , hence abruptly ending there. can 1 please suggest solution issue.

thank in advance.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -