If the fist column (chr) is the same in ALL files, i want to compare column 3 and 4 (start and end).
If in ALL files the regions are overlapping, I want to return the smallest start position and the largest end position to get the complete region in which there are overlapping reads.
So for this input the output would be:

Because there is a region that is overlapping in all files.
I want to do this, ONLY if ALL 4 files are overlapping.
I wrote a script now to check for all possible combination for overlapping reads, but because of all the many possible combinations I think it wont be finished in this week...
This is my script now: