Simple for
loop:
for f in ./*.gz; do
convert.py "$f" > "${f%.gz}.txt"
done
Using the find
command:
find . -maxdepth 1 -name '*.gz' -exec sh -c 'convert.py "$1" > "${1%.gz}.txt"' sh {} \;
or
find . -maxdepth 1 -name '*.gz' -exec sh -c '
for f; do convert.py "$f" > "${f%.gz}.txt"; done
' sh {} +
(there's really no advantage to using find
in this case).