3 ms·
This ones a hard one. Since "--version-sort" isn't standard anyways, lets assume we can use flags which are common to BSD and GNU. Furthermore, lets assume bash
by genrilz 2y ago
This ones a hard one. Since "--version-sort" isn't standard anyways, lets assume we can use flags which are common to BSD and GNU. Furthermore, lets assume bash or zsh so we can use "read -d ''".
In that case, how about:
IFS='' read -d '' latest < <(find $pattern -prune -print0 | sort -z --reverse --version-sort)