- Products
- Learn
- Local User Groups
- Partners
-
More
Join Us for CPX 360
23-24 February 2021
Important certificate update to CloudGuard Controller, CME,
and Azure HA Security Gateways
How to Remediate Endpoint & VPN
Issues (in versions E81.10 or earlier)
IDC Spotlight -
Uplevel The SOC
Important! R80 and R80.10
End Of Support around the corner (May 2021)
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?
As a follow-up to this issue, a HF was created to fix this. I've asked for the fixed to be included in a future jumbo.
I'm not seeing it in R80.10, which is why I thought it was strange. I did update my command to use sed to replace the junk characters where I'm wiping the ^M and anything before it... sed -e 's/^.*^M//'. Just seems odd.
As a follow-up to this issue, a HF was created to fix this. I've asked for the fixed to be included in a future jumbo.
About CheckMates
Learn Check Point
Advanced Learning
WELCOME TO THE FUTURE OF CYBER SECURITY