#!/bin/bash #SAMPLES=($(find /vagrant/First\ phase\ evaluation/ -name '*.ts')) #echo $SAMPLES find /vagrant/First\ phase\ evaluation/ -name '*.ts' -exec sh -c ' for file do python api_testing.py $file done ' sh {} + ## now loop through the above array #for i in "${SAMPLES[@]}" #do # echo "$i" # or do whatever with individual element of the array #done