Eu costumo fazer isso com arrays associados / hash no bash (outros shells são diferentes).
declare -A file_values=( [file1]="value1" [file2]="value2" )
mapfile files < <( find /tmp/DIR -name "File?" -printf "%f\n" )
for f in "${files[@]}"
do
output="output from file $f"
if [ "${output}" = "${file_values[${f}]}" ]; then
...
fi
done