0

This seems to come up a few times. I'll be trying to spot differences in logs with repeating cycles. For example:

start
1
2
3
end
start
1
2
4
3
end

Rather than scrolling through pages of terminal output it would be nice to have some structure to the log. The tool watch can run a command at some interval, and even highlight changes with -d. Is there an easy way to split up the output from a program that prudces the above into blocks between start/end?

Just viewing changes in real-time from a fixed line within the cycle would be nice so I could spot changes. Being able to scroll through cycles would be great too.

0

Wrote something small in the meantime. It's not great but gets the job done.

https://github.com/pknowles/watch_cycles

cat log.txt | ./watch_cycles "start"

Shows, for example:

page 2/2
start
1
2
4
3
end

Arrow keys scroll to previous pages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.