I fixed the earlier problem about "-ge: unary operator expected". It turns out that the end-of-run records for runs 8409 and 8410 are incomplete. Only the EPICS section is present, the DAQ-related part (first section) is absent. These incomplete files confused the script. Now, a message is printed that the end-of-run entry is incomplete and will be skipped.