# get "R_files_3.txt" using lines inside "check_R_files.txt"
# run this script as below.
# check_R_files will not work if in directory being searched 
# ./check_R_files R_files_3.txt /Users/dsmith/Work/RH_pools_1 > ans.txt


while IFS= read -r f; do
    if [[ -n $(find $2 -name $f) ]]; then
        printf 'SUCCESS, %s exists in %s\n' "$f" "$2"
    else
        printf 'FAIL, %s is missing in %s\n' "$f" "$2"
        # exit 1
    fi
done < "$1"