in task4b the for loop need to be done in executeWithPipes, need to hadle arrays index for command in a proper way