Has anyone noticed hidden output (Processing line X out of Y ^M) when running the clish -f command from expert mode? I noticed it on the R80.30 3.10 kernel when using clish -f somefile.txt.
1. I built a script:
[Expert@gw-name:0]# cat /tmp/script-to-get-asn.sh
set virtual-system 1
show configuration bgp
2. I run the script and get some output:
[Expert@gw-name:0]# /bin/clish -i -f /tmp/script-to-get-asn.sh 2> /dev/null | grep -E "set bgp external remote-as [0-9]+ on"
set bgp external remote-as 12345 on
3. I want to grab the ASN, but things get weird...
[Expert@gw-name:0]# /bin/clish -i -f /tmp/script-to-get-asn.sh 2> /dev/null | grep -E "set bgp external remote-as [0-9]+ on" | awk '{print $5}'
of
4. I save my output to a temp file and cat it... looks normal...
[Expert@gw-name:0]# /bin/clish -i -f /tmp/script-to-get-asn.sh 2> /dev/null | grep -E "set bgp external remote-as [0-9]+ on" > tmpfle
[Expert@gw-name:0]# cat tmpfle
set bgp external remote-as 12345 on
5. I look closer by doing a cat with a -v or vi the file and I see text that did show up earlier along with ^M...
[Expert@gw-name:0]# cat -v tmpfle
Processing line 2 out of 2 ^Mset bgp external remote-as 12345 on
[Expert@gw-name:0]#
What's going on here?