I have script to open a text file which has a list of 1650 site locations. I am attempting to loop thru this list print two separate lists of files 1) which are found and 2) which are missing. The list of site locations is a single column. The problem I am running in to is the script is not reading the input file and looping thru it. The script is just looking for the the single file "instead of reading and looping thru each line of this file".
#!/bin/bash
file=Sites-1.txt
do
if "$file" ;
then
echo "$file found" >> found.tmp
else
echo "$file has not been found" >> missing.tmp
fi
done
input example from Sites-1.txt for files looking for
01-033-0043-SO2-2014.dat.out
01-033-0044-SO2-2014.dat.out
01-033-1002-SO2-2014.dat.out
01-071-0020-SO2-2014.dat.out
01-071-0026-SO2-2014.dat.out
Expected output files composition
found.tmp
01-033-0043-SO2-2014.dat.out found
01-033-0044-SO2-2014.dat.out found
01-071-0026-SO2-2014.dat.out found
missing.tmp
01-033-1002-SO2-2014.dat.out has not been found
01-071-0020-SO2-2014.dat.out has not been found