I have a python script which takes some parameters, and I want to run this script on all the sub directories starting from the one that the script is inside.
The idea is I want to get a custom output of the script to be saved in the file.
here's what i've done:
for x in `find . -type d | grep data`;
do
python /full/path/to/file/script.py -f "%a
%t" $x/*.txt -o $x/res.txt
done
But this is not working and I don't know why. The grep
in the for loop is to only get the directories that contains .txt files and apply the script on them.
The new line between %a and %t is because I want to customize the output of the output of the python script to include a new line between each 2 variables
What am I doing wrong ?