I have a folder with scripts with a name pattern of UPDATE[x.y.z] where x.y.z is the script’s version.
What I need is a bash script that runs the scripts ordered by their version, hence alphabetic sort is not good.
For example UPDATE1.11.0 should be executed after UPDATE1.2.3.
is there a comparator I can use on order to dictate that sorting order? if not, how else can it be done?
And if you don’t have GNU sort (i.e. you’re in OSX or FreeBSD or NetBSD), you may be able to fake it by sorting different fields.
This misses out on the major version number because it’s not delimited by a dot. But it may work for you anyway.