I need a script that connects to a device on my network and export a list of data...

#!/usr/local/bin/expect -f
spawn telnet hostname
expect -exact "Username:"
send -- "username\r"
expect -exact "Password:"
send -- "password\r"
expect "#"
send -- "command\r"
interact
expect "#"
send -- "logout\r"`

I get some desired output but not completely. The output has more than 4000 lines and at line 80 the script gets a line " --More-- " waiting for user.

How can I get the full output?

Is your command possibly the "more" command? Try cat.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.