I'm wondering whether it's better moved this into the loop above. If we have 11 x 100MB core files, the first loop will discard the 11th because 1100MB > 1GB, but this loop will compress the cores to a size < 1GB, so we've discarded a core file for no reason.