I have csv file (products.csv) with product numbers$ cat products.csv | head -32.202.212.22in another directory I have thousands of product images in subdirectories.I need to locate product images based on product number from products.csv file.I have written a simple bash script to locate them:#!/bin/shPRODUCTS_FOLDER=products;PRODUCTS=products.csv;for x in `cat $PRODUCTS`;do    FILE=`find $PRODUCTS_FOLDER -follow -iname $x*`;    if [ -n $FILE ]; then            echo Product $x found:;            echo --> $FILE <--;    else            echo Product $x not found;    fi    echo -----------------------------------;donebut it is not doing exactly what i need. In results i can find following:-----------------------------------Product 14.144 found:--> products/Buchzeichen/14.144_Interlaken_sortiert.jpgproducts/Motive/14.1448.jpgproducts/Motive/14.1445.jpgproducts/Motive/14.1449.jpgproducts/Motive/14.1446.jpg <-------------------------------------Correct result should contain only pictures with that number (14.444) without 14.1448, 14.1445, 14.1449, 14.1446What regular exp should i use in find to get expected result? Or maybe, there is another way to solve it?Your ideas or suggestions are highly appreciated
regexp in find to locate only
bash;shell script;find;regular expression
The following regular expression should work:-regex .*/$x[^0-9].*It contains the number right after the slash followed by a non-number.