The issue within the for loops to remove python shebangs and to remove the execution flag from python files has been solved.