I'm writing a bash script for some automation, and I can't seem to find the best way of sorting an array that contains dates.
An example array:
dates=('180212', '110112', '040312')
The output should be as follows:
110112
180212
040312
I've tried to use sort but it just sorts it as if it were a integer.
Could anyone advise on the best method to use? It doesn't necessarily have to sort either, I just need the oldest date from the array.
Thanks!