Usando find
:
#!/bin/bash
path="/home/userA/folder"
find "$path" -maxdepth 1 -type f -name "*.txt" -print0 | while read -d $'#!/bin/bash
path="/home/userA/folder"
find "$path" -maxdepth 1 -type f -name "*.txt" -print0 | while read -d $'%pre%' file; do
a="$path/$(basename $file)/a_%06.jpg"
echo "$a
done
' file; do
a="$path/$(basename $file)/a_%06.jpg"
echo "$a
done