[j-nsp] Does Junos cli support colors?

Alexander Dube nsp at layerwerks.net
Thu Mar 15 11:53:22 EDT 2018


Hi Martin,

not exactly what you need, but if you use MacOS with iterm, you can use regex to colorize your output. 

I colorzied up and down interface status in a very basic way:

https://abload.de/img/bildschirmfoto2018-03j4ov6.png

Regards
Alex




Martin T <m4rtntns at gmail.com> schrieb:
>Hi!
>
>When I start an ash shell and use terminal escape codes, then string
>"Hello" is printed in red as expected:
>
>user at vMX> start shell sh
>$ echo $TERM
>screen
>$ echo -e "\e[31mHello\e[0m"
>Hello
>$
>
>Is it possible to print colors in Junos cli? My cli terminal type is
>also "screen" according to "show cli" command. I tried with few
>jcs:output functions like:
>
>expr jcs:output("\\\e[31mHello\\\e[0m\s");
>expr jcs:output("\e[31mHello\e[0m");
>
>..and with <output> elements like:
>
><output> "\\\e[31mHello\\\e[0m";
><output> '"\\\e[31mHello\\\e[0m"';
>
>
>I guess it is not possible to use colors in SLAX scripts?
>
>
>thanks,
>Martin
>_______________________________________________
>juniper-nsp mailing list juniper-nsp at puck.nether.net
>https://puck.nether.net/mailman/listinfo/juniper-nsp
>


More information about the juniper-nsp mailing list