I have a current script to get all .jpg and .jpeg files in a folder, my bash script is as follows
shopt -s nullglob
CURRENT_IMAGE_FILES=($DIR/*.jpg $DIR/*.jpeg)
echo ${#CURRENT_IMAGE_FILES[@]}
shopt -u extglob
The results being output are as follows (1.jpg , 3.jpg , 5.jpg , 2.jpeg ,4.jpeg). Being that the serach follows all .jpg first then the rest of the .jpeg being found.
The issue with this code is that it get's all jpg files first then gets all jpeg files. I however want to get all jpg and jpeg files in increment as follows (1.jpg, 2.jpeg, 3.jpg, 4.jpeg, 5.jpg)