The following bash snippet works great when there are actually *.txt files in the directory.
for txt in *.txt
do
echo "loading data from $txt"
done
When there aren't, the literal *.txt falls into the loop as $txt (not good).
How do I change this code so that when there are no *.txt files, the do ... done block is skipped?