Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by aitap (Curate)
on Aug 13, 2020 at 19:27 UTC ( #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 (Canon) 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
Node Status?
node history
Node Type: note [id://11120692]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2020-09-18 23:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (113 votes). Check out past polls.

    Notices?