View Single Post
Old 02-19-2017, 05:54 AM   #33
Hanspeter
Connoisseur
Hanspeter doesn't litterHanspeter doesn't litter
 
Posts: 77
Karma: 150
Join Date: Jul 2014
Device: Kindel PW1, Voyager
Hi Yourcat,

thanks for your hints.

Quote:
Originally Posted by Yourcat View Post
Simply replace it, the pipe is supported within backticks. Anyhow `date +%X|cut -d':' -f-2` is much faster, no need for sed here.
Good point to use cut instead of sed. But for me it has the same problem as the command includes an additional ':'. If you look into the awk command I aöready have two nested hypens and I have no idea how to add the third once without braking the code.

Code:
awk '/.*PageTurnAction*./ || /.*JunoExecutionManager*./  {system("eips ${POS} ${ROW} \"`date +%H:%M`\"")}'
Quote:
Originally Posted by Yourcat View Post
Also the regexps in awk should be optimized. '.*' matches the whole line and then the regexp engine goes back one character after the other and tries to match the following string. The longer the lines are the more CPU is used. I expect that the log lines are formatted and one could use a regexp without '*' - it may look complicated but it will match faster.
I'm not the best in regexp and awk. I simply copied the line from an other post. That is what the log looks like including a line with the PageTurnAction that triggers the display of the information.

Code:
170211:114536 cvm[5359]: I LprHandler:Information::Not showing dialog since LPR does not exist
170211:114542 cvm[5359]: I LprHandler:Information::Not showing dialog since LPR does not exist
170211:114545 powerd[3080]: I lipc:evts:name=t1TimerReset, origin=com.lab126.powerd:Event sent
170211:114545 cvm[5359]: I GlobalKeyEventDispatcher:Information::Receiving WhisperTouch key event
170211:114545 cvm[5359]: I LprHandler:Information::Not showing dialog since LPR does not exist
170211:114545 cvm[5359]: I ContentPanel:UserActionInfo:PageTurnAction=NextPage:
170211:114545 winmgr[3881]: I Inverting the page turns. currentOrientation=U:::
170211:114545 winmgr[3881]: I WindowManager:handleWhisperTouchPress:forwarding wt press to
HaPe
Hanspeter is offline   Reply With Quote