Hi, I'm trying to loop over each *.faa file in multiple directories (e.g. /path/to/*.faa)
And then, using a script (./script.py) as if the script was in the same directory as the *.faa file, is this possible with shellscript?
What I've tried:
for FAA in $(find . -name "*.faa") do cd ../$FAA python3 ../script.py done
I've tried variations on this, but changing to the directory to a file doesn't work, but I don't know a way of getting to that directory.
For each .faa file, in multiple directories e.g /path/to/1.faa, path/2/2.faa, run the script in the directory two levels above. As if it were in the same directory as each of the *.faa files, or if that's not possible, what is the best solution to achieving something similar?