In this example, I have a directory of 2 PNG files:
% ls test_folder
1.png 2.png
Listing all PNG files within the directory works:
% echo test_folder/*.png
test_folder/1.png test_folder/2.png
However, checking if a directory contains any PNG file always returns false.
% if [[ -f test_folder/*.png ]]; then echo 'found'; else echo 'not found'; fi
not found
I've been told by this guide that this would work. Where did I go wrong? And please excuse my limited understanding of Bash.