Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

networking newbie needs help! space bar character??

Status
Not open for further replies.

mb111280

Technical User
Oct 24, 2001
9
0
0
GB
help, i only been learning tcl for a day now, for the sole purpose of this program, and future networking tasks. So any help would be appreciated

ive written a script using tcl/expect, to telnet onto a cisco reuter and download the ip accounting stats. my problem is that after a page worth of stats is shown, it waits for either a space bar to show the nexts page content, or a return to show the next line. my script works fine, but very slow using the return key, ie /r, but to work properly, it needs the space bar. ive tried /s but it doesnt like it. heres the peice of script in concern:

set temp "y"
while { $temp == "y" } {
expect "More" { set temp y } "#" { set temp "n" }
send &quot;\r&quot; <--------------------
}

help if you can please
 
Don't know about sending a 'space bar' control to a
remote process. The ansi char table has it listed as
hex 20.
In theory send &quot;\x20\r&quot; might work.

Otherwise you could just wrap your line oriented
return in a page , half page and user defined
interact sequence:
Code:
expect {

         -gl &quot;*More*&quot; {
               interact {
                 ~fp {set x 1 ; while {$x < 45} {send &quot;\r&quot; ; incr x}}
                 ~hp {set x 1; while {$x < 25} {send &quot;\r&quot; ; incr x}}       
                 ~up {set x 1 ; send_user &quot;Number of lines
to skip: &quot; ; set num [gets stdin] ; while {$x < $num} {send &quot;\r&quot; ; incr x}}
               }
            } 
}
 
its alright, i sorted in the end. thanks for your help though!!! all i needed to use was &quot; &quot;. sometimes things have simple solutions, must remember that
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top