This is the content of my text file named fnames.txt:
"SAMPLE_NIKE_856_20170703*"
"SAMPLE_ADIDAS_856_20170702*"
"SAMPLE_ANTA_856_20170630*"
"SAMPLE_JORDAN_856_20170627*"
"SAMPLE_CONVERSE_856_20170229*"
This is my script named fn.sh:
#!/bin/sh
#
#
while read LINE
do
find -name "$LINE"
done < fnames.txt
It returns nothing.
What I want to happen is that in each line the script will execute the find command and the output will be stored in another text file called files.txt e.g:
LINE 1:
find -name "SAMPLE_NIKE_856_20170703*"
then returns the filename that is looking for
./SAMPLE_NIKE_856_20170703_80_20_304_234_897.dat
LINE 2:
find -name "SAMPLE_ADIDAS_856_20170702*
then returns the filename that is looking for
./SAMPLE_ADIDAS_856_20170702_56_98_123_245_609.dat
The script will continue until all lines has been executed by find command.
find
, if you run your script in the right directory. Secondly, to store the results in a text file you can addecho "$Line" >> out.txt
to your loop.