I have a directory of pictures, which can contain jpeg, jpg, and png files. I want to loop through them in a bash script. Its possible for the directory not to contain any png files, or jpeg files, or jpg files. If a file extension doesn't exist, my script gives an error. How to ignore these?
for file in *.{jpg,jpeg,png} ; do
echo $file