In a directory, I have a number of files, and I need to do something with the most recently modified file with a .txt suffix.
Ideally, I'd like to do
myutility "$newest" in the end, where $newest would be the pathname of the most recently modified file.
It would be nice if this additionally could be generalised so that I could get the most recently modified file with a .txt suffix in a directory hierarchy, and even better if I could get the, say, five most recently modified files so that I could use
myutility "${newest[@]}" to run my utility on the five most recently modified .txt files in a whole directory hierarchy.
A solution using bash or ksh93 would be best.