he below looks in $dir for any pattern of fileone . As is, it executes but only returns File found if the exact format in the script exsists. Why isn't a pattern of fileone being looked for and if it is in
$dir, File found. I think that is what should happen. Thank you :).
dir=/path/to
if ls "$dir"/fileone.csv* > /dev/null 2>&1
then
echo "File not found!" >> "$dir"/log && exit 0
else
echo "File was found, moving on " >> "$dir"/log
fi
If any of the below are in $dir then File found was found, moving on.
fileone.csv
fileOne.csv
Fileone.csv
FileOne.csv
If none of those or alike exist, it will echo "File was found and exit. The pattern will always be fileone.csv just the case may be different. Maybe there is a better way? Thank you :).