Andy.
I am running putty on Windows. if I run "sh interface terse", the display stops and --more-- is displayed.
I believe it might just be how the script is handled on EX switch vs the srx. I have opened a service call with Juniper and I'll see what comes up. In my code, I included a parameter for the stack member number so it limits the output for that member only which is more user friendly.
Thanks for your time.
Thanks Andy for helping.
Original Message:
Sent: 04-18-2024 11:22
From: asharp
Subject: op script - Is there a way to break at page with "more" being shown
I was running my test initially on a SRX210 cluster running 12.1X46, which is the only physical hardware I had within reach on my desk. I ran the same script on vMX and the behaviour was the same, in that the script displays ---(more)--- as I would expect that it would, and that vMX is running 22.1R1.10.
I wonder if it is something particular to the terminal s/w that you are using that is producing the behaviour that you are getting? Do you see the same behaviour with a different terminal software?
I've tried a few different terminal apps on MacOS and Win10 and all with the same behaviour (terminal, warp, iterm2, putty, openssh) , even tried using a console connection and again the same as well. So unless it is something specific to that version of Junos (maybe??) I'm at a loss as to why you are not getting a ---(more)--- prompt by default
------------------------------
Andy Sharp
Original Message:
Sent: 04-18-2024 09:11
From: YVON LEDUC
Subject: op script - Is there a way to break at page with "more" being shown
Thanks Andy.
Interesting.
I ran the exact same code and on my switch, it just does not stop even after setting the screen lenght to 10.
(Hostname: 2S-205-Lab_EX4300
Model: ex4300-48p
Junos: 21.4R3)
------------------------------
YVON LEDUC
Original Message:
Sent: 04-18-2024 04:17
From: asharp
Subject: op script - Is there a way to break at page with "more" being shown
I mean to say that my script does display ---more---
asharp@SRX-Node0> file show /var/db/scripts/op/mytest.slaxversion 1.0;ns junos = "http://xml.juniper.net/junos/*/junos";ns xnm = "http://xml.juniper.net/xnm/1.1/xnm";ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0";import "../import/junos.xsl";match / { <op-script-results> { <output> { var $rpc = <get-interface-information>; var $conn = jcs:open(); var $results = jcs:execute($conn, $rpc); for-each ($results/physical-interface) { expr "Interface Name " _ ./name _ "\n"; } expr jcs:close($conn); } }}asharp@SRX-Node0> set cli screen-length 20Screen length set to 20{secondary:node0}asharp@SRX-Node0> op mytestInterface Name ge-0/0/0Interface Name gr-0/0/0Interface Name ip-0/0/0Interface Name ge-0/0/1Interface Name fe-0/0/2Interface Name fe-0/0/3Interface Name fe-0/0/4Interface Name fe-0/0/5Interface Name fe-0/0/6Interface Name fe-0/0/7Interface Name ge-2/0/0Interface Name ge-2/0/1Interface Name fe-2/0/2Interface Name fe-2/0/3Interface Name fe-2/0/4Interface Name fe-2/0/5Interface Name fe-2/0/6Interface Name fe-2/0/7Interface Name fab0---(more)---asharp@SRX-Node0> set cli screen-length 10Screen length set to 10{secondary:node0}asharp@SRX-Node0> op mytestInterface Name ge-0/0/0Interface Name gr-0/0/0Interface Name ip-0/0/0Interface Name ge-0/0/1Interface Name fe-0/0/2Interface Name fe-0/0/3Interface Name fe-0/0/4Interface Name fe-0/0/5Interface Name fe-0/0/6---(more)---
------------------------------
Andy Sharp
Original Message:
Sent: 04-17-2024 17:05
From: YVON LEDUC
Subject: op script - Is there a way to break at page with "more" being shown
hello Andy,
In your comment you mentioned
"I've never had any issue with "---(more)---" being displayed for op scripts. "
does you mean the result that your script generate don't stop until everything is shown? I was hoping to find a way to show my list in such a way that I would see a "---(more)---" every so many lines.
I modified my script to only have one set of <output> but it is still showing something like 250 rows in one shot.
also, my cli screen-length is set.
Regards.
------------------------------
YVON LEDUC
Original Message:
Sent: 04-17-2024 14:09
From: Andy Sharp
Subject: op script - Is there a way to break at page with "more" being shown
I've never had any issue with "---(more)---" being displayed for op scripts. Although, I don't usually print to screen using <output> jcs:printf("");
My approach has always been to declare <output> just once, e.g.
main <op-script-results> { <output> { /* print stuff here */ }}
Then depending on what I need to print, I would mostly just use: expr, uexpr or jcs:printf as required.
Of course, also make sure that screen-length is recognised in your terminal.
e.g.
> show cliCLI complete-on-space set to onCLI idle-timeout disabledCLI restart-on-upgrade set to onCLI screen-length set to 62CLI screen-width set to 187CLI terminal is 'xterm-256color'CLI is operating in enhanced modeCLI timestamp disabled> set cli screen-length 80Screen length set to 80
Regards