View Single Post
Old 02-19-2017, 01:37 AM   #31
Yourcat
Groupie
Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.
 
Posts: 175
Karma: 54048
Join Date: Mar 2016
Device: PW3 5.6.5-usbnet
Simply replace it, the pipe is supported within backticks. Anyhow `date +%X|cut -d':' -f-2` is much faster, no need for sed here.
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.
Yourcat is offline   Reply With Quote