Expect script to read file line by line

view story

http://www.unix.com – I have an expect script which is run inside a bash script. I am trying to ssh to a jump server then from the jump server telnet to each router in a file list and run the same command. I tried many ways but down not read the router list file for some reason. I get the following error: wrong # args: should be "read channelId ?numBytes?" or "read ?-nonewline? channelId" while executing "read " Code: /usr/local/bin/expect << EOF   ### ssh to jump server spawn /opt/SBCssh/bin/ssh [email protected] match_max 100000 expect "*?assword:*" send (HowTos)