I wrote a script for a Linux bash shell.
One line takes a list of filenames and sorts them. The list looks like this:
char32.png char33.png [...] char127.png
It goes from 32 to 127.
The default sorting of ls
of this list is like this
char100.png char101.png [...] char32.png char33.png [...] char99.png
Luckily, there is sort
, which has the handy -V
switch which sorts the list correctly (as in the first example).
Now, I have to port this script to OSX and sort
in OSX is lacking the -V
switch.
Do you have a clever idea of how to sort this list correctly?