I have a directory organized into subdirectories in the manner of:a1b1c1c2c3d1I'm trying to perform loop that only executes on the most recent subdirectory of a given letter, ie it would loop through a1, b1, c3, and d1, but ignore c1 and c2. My efforts so far have revolved around directly trying to compare the numeric values of the subdirectory names, but that hasn't worked out very well. I'm new to bash, so apologies if this is a simple fix that I'm missing.
How to skip over subdirectories in a for loop based on name alone?
bash