Re: Making screen look for a pattern to detect "activity"
Hari Bhaskaran <[email protected]> Fri, 19 May 2006 16:18:22 -0700
| Newsgroups | gmane.comp.gnu.screen |
|---|---|
| Message-ID | <446E523E.9010501__9155.56790209866$1238088950$gmane$org@gmail.com> |
Thanks for the suggestion. However it would have been nice if screen could do this. I would then be able to monitor commands I hadn't anticipated the need for monitoring when I started the command. If I were to try to patch such a thing on to screen, where should I start? I can see screen.c 's serv_select_fn() to be one place where I would probably look for the pattern and then set from p->w_monitor ? Any pointers/helpful hints are much appreciated. -- Hari on 5/19/2006 12:31 PM Joe Zbiciak said the following: > One way might be to pipe the program's output through 'grep.' If you want to see the full output also, you could do something hackish like: > > mknod foo p > program | tee foo > screen grep pattern foo > > Then set screen's activity monitor on the newly opened screen containing the grep output. > > --Joe > > --We sell Spatulas, and that's all! > http://spatula-city.org/~im14u2c/ > http://sdk-1600.spatula-city.org/ > http://intyos.spatula-city.org/ > > ----- Original Message ---- > From: Hari Bhaskaran <[email protected]> > To: [email protected] > Sent: Friday, May 19, 2006 1:13:52 PM > Subject: Making screen look for a pattern to detect "activity" > > Hi, > > I want to make screen look for a certain configurable pattern in the > output to detect "activity" (for the montoring feature > Cntrl-a M thingy). I am running a custom program which would print a > certain pattern that I want to watch for, not > necessarily a strict "silence" or "activity"- which currently means any > output. > > Is there a way to achieve this in screen? Any help is appreciated > >