Home How to use shell to continuously process tail -f new lines in real time?
Reply: 0

How to use shell to continuously process tail -f new lines in real time?

user813
1#
user813 Published in June 19, 2018, 11:57 pm

There is a file on the linux server, which new lines appended to it aperiodically. I need to process new line, parse it and use other command or script to process it . Check the file periodically is not acceptable, I need a real time solution. No other language (Python, Perl) is available on the server, only shell.

Now, I'm trying to assign the new line to a shell variable, and then process it. But can not find a good way to do that. Another problem is I need to rely on some result former when processing new lines. For example, when I process the 11th line, maybe the 5th line result is required. So some variables needed to store the result before, and I need to use them in the loop.

Any solution or any better suggestion for my case?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.306715 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO