Not sure if many people wrestle with this problem, but I generate scripts every now and would like to utilize a clear screen at time.
Well this is what I came up with: use the "send" command with some escape characters.
send {line-number | * | aux number | console number | tty number | vty number}
I use the "who" to find what line I am on (denoted by the * in the first column) and use that line number.
Now the escape sequence would be ^[[H^[[J
when you do it though you have to do a ^v first so you would actually type: (just to clarify: the ^ is the control key)
^v^[[H^v^[[J
This is what everything will look like when on the screen:
Switch#who
Line User Host(s) Idle Location
* 1 vty 0 idle 00:00:00 windecs1.mis.dkc.com
Interface User Mode Idle Peer Address
Switch#send 1
Enter message, end with CTRL/Z; abort with CTRL/C:
^[[H^[[J^Z
Send message? [confirm]
Switch#
a clear screen will follow. Remember the ^[ is actually preceded by a ^v, but that won't display.
Looks tough to do, but I use it for scripts and thus is not too complex.
If anyone has another or better way I would be curious to see how you do it.
Just thought that I would share this, since i have used many of the suggestions in this group.
Well this is what I came up with: use the "send" command with some escape characters.
send {line-number | * | aux number | console number | tty number | vty number}
I use the "who" to find what line I am on (denoted by the * in the first column) and use that line number.
Now the escape sequence would be ^[[H^[[J
when you do it though you have to do a ^v first so you would actually type: (just to clarify: the ^ is the control key)
^v^[[H^v^[[J
This is what everything will look like when on the screen:
Switch#who
Line User Host(s) Idle Location
* 1 vty 0 idle 00:00:00 windecs1.mis.dkc.com
Interface User Mode Idle Peer Address
Switch#send 1
Enter message, end with CTRL/Z; abort with CTRL/C:
^[[H^[[J^Z
Send message? [confirm]
Switch#
a clear screen will follow. Remember the ^[ is actually preceded by a ^v, but that won't display.
Looks tough to do, but I use it for scripts and thus is not too complex.
If anyone has another or better way I would be curious to see how you do it.
Just thought that I would share this, since i have used many of the suggestions in this group.