R
R
ramjke2018-01-31 18:31:45
linux
ramjke, 2018-01-31 18:31:45

How to jump to a specific line in a file in Bash?

There is a log. It is necessary to go through the entire log and compare the value from the log piece with the value that was a second earlier.
With the help of awk and sed it was not possible to write (I could not reconcile with the loop and setting variables).
Help me please

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xotkot, 2018-01-31
@xotkot

The question is too vague.
I can assume that it is necessary to find lines in the log where the parameter we need has changed relative to the previous one, for example:

Л="дело1 было утром
дело2 было утром
дело3 было днём
дело4 было днём
дело5 было днём
дело6 было вечером
дело7 было вечером
дело8 было ночью"

Let's say there is a log L and you need to find the lines where the third parameter has changed:
you can even simplify the notation: it will output:
дело1 было утром
дело3 было днём
дело6 было вечером
дело8 было ночью

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question