Ah. I see. That was because you wanted to exclude the current macro. I was a blind follower, haha. It was mainly because I did not comprehend the script (I still don't understand the sed
command there).
After many tries and fails, I managed to accomplish with tail, grep, awk, grep, tail
. (Since I only want to find the target macro, I don't have to restrict myself to the last 10 macros. I just use the last, say, 40 lines, of the engine log.
I like this version more and have replaced the one in the OP with this one.