I have show command for a device with its Mac address, which i am executing in perl using Expect.pm.
The output of command is more than 100 line with --More--
at the bottom.
I am able to capture output everything before first occurance of --More--
.
But not after that.
I tried with while loop it is not working for me.
Please help me resolve this.
Asked
Active
Viewed 149 times
0

pynexj
- 19,215
- 5
- 38
- 56

Kiran Kulkarni
- 3
- 3
-
are you using the Perl module [Expect.pm](http://search.cpan.org/~rgiersig/Expect/Expect.pod) or the [tag:expect] program? – pynexj Sep 05 '17 at 08:51
-
In perl program i am using Expect i.e. use Expect; – Kiran Kulkarni Sep 05 '17 at 10:06
1 Answers
3
I Suspect you're connecting to a Cisco Device. if so, issue "term len 0" upon logging onto the node. if juniper, add " | no-more" to the end of every command.

hoffmeister
- 612
- 4
- 10
-
Yes i am using cisco device. i am using show command with begin/include i.e show arp | begin mac adress. i am new to this could you please give some example how to set terminal length in perl. – Kiran Kulkarni Sep 05 '17 at 10:20
-
Ok, "term len 0" will fix your problem. Issue the command after logging onto the box. Then the whole text will be displayed for each command – hoffmeister Sep 05 '17 at 10:22
-
Great, i've found with Cisco's that | can confuse the output (or maybe just using utility on the XR). Sometimes it's better to just do a "show arp" then use find the line you need in exp_before() . – hoffmeister Sep 05 '17 at 13:39