greycat 1480446468 learn You can't use ls -t in a script. Sorry. See http://mywiki.wooledge.org/ParsingLs and http://lists.gnu.org/archive/html/help-bash/2016-11/msg00033.html and !latest and !rlart for some alternatives.