Junos
Highlighted
Junos

multiple commands

‎05-26-2020 06:17 AM

when using the following, output(s) are not stand out, it is confusing. how to put at least one empty line between outputs?

start shell sh command "cli -c 'sh sys alarm;sh chass alarm;sh system core'"

 

2 REPLIES 2
Highlighted
Junos

Re: multiple commands

‎05-26-2020 06:47 AM

Hi Arix,

 

The below should help. Just add echo "" where you want to introduce a new line.

Example:

#!/bin/sh

cli -c "show version"
sleep 1
echo ""
cli -c "show system uptime"
sleep 1

 

The output looks like this:

% sh arix1.sh
fpc0:
--------------------------------------------------------------------------
Hostname: xx
Model: xx
Junos: 14.1X53-D46.7
JUNOS Base OS boot [14.1X53-D46.7]
JUNOS Base OS Software Suite [14.1X53-D46.7]
JUNOS Kernel Software Suite [14.1X53-D46.7]
JUNOS Crypto Software Suite [14.1X53-D46.7]
JUNOS Online Documentation [14.1X53-D46.7]
JUNOS Enterprise Software Suite [14.1X53-D46.7]

fpc0:
--------------------------------------------------------------------------
Current time: 2020-05-26 06:42:40 PDT
System booted: 2019-10-16 14:19:57 PDT (31w5d 16:22 ago)
Protocols started: 2019-10-16 14:24:40 PDT (31w5d 16:18 ago)
Last configured: 2020-05-20 07:40:52 PDT (5d 23:01 ago) by root
6:42AM up 222 days, 16:23, 2 users, load averages: 0.28, 0.29, 0.30

 

Hope this helps 🙂

 

Please mark this post "Accepted Solution" so that it can help others too.

Kudos are always appreciated 🙂

 

 

Highlighted
Junos

Re: multiple commands

‎05-27-2020 04:29 AM

Hi Arix

 

You can use the following to run multiple commands with a space line between them

 

>start shell sh command "cli -c 'show sys alarm' ; echo \"\" ; cli -c 'show chass alarm'"

 

Hope this helps.

 

 

Feedback