Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: [OT] Filtering / Highlighting serial port input / PuTTY output

by aitap (Curate)
on Aug 13, 2020 at 19:27 UTC ( [id://11120692]=note: print w/replies, xml ) Need Help??


in reply to [OT] Filtering / Highlighting serial port input / PuTTY output

If you just need a resizeable terminal to run Perl in, you could always use Cygwin's mintty or ConEmu.
  • Comment on Re: [OT] Filtering / Highlighting serial port input / PuTTY output

Replies are listed 'Best First'.
Re^2: [OT] Filtering / Highlighting serial port input / PuTTY output
by afoken (Chancellor) on Aug 14, 2020 at 12:08 UTC
    If you just need a resizeable terminal to run Perl in, you could always use Cygwin's mintty or ConEmu.

    ConEmu did the trick, combined with pryrt++'s plink idea. It took a little configuration to make it look like a boring console window again, mainly invoking cmd.exe without parameters, using the default windows color scheme, and hiding the status bar and the tab bar.

    Thank you!

    And now that perl is involved, and ConEmu supports ANSI, I already consider using ANSI sequences to highlight matching lines instead of filtering out all irrelevant lines ...

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

      Getting rid of unwanted lines:

      plink -serial COM24 -sercfg 115200,8,n,1,N | perl -ne "/^(Pct|NRS)/ && + print"

      Highlighting interesting lines instead:

      plink -serial COM24 -sercfg 115200,8,n,1,N | perl -MTerm::ANSIColor -n +e "print colored($_, /^(Pct|NRS)/ ? 'bright_yellow' : 'white')"

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11120692]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-19 06:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found