You can store in an array
Code:
files=(*temp)
echo "in one row:"
echo "${files[@]}"
echo "on separate rows:"
printf "%s\n" "${files[@]}"
Or you can store in a simple variable, best in rows:
Code:
files=$(printf "%s\n" *temp)
echo "$files"
Or you use a loop; treating each file individually enables you to test them
Code:
for file in *temp
do
[ -f "$file" ] || continue
echo "$file"
done
If you want to append to a logfile, then
(one open/close) is more efficient than
Code:
echo "$file" >> logfile
(open/close) for each loop cycle.