latest-file.sh 156 B

12345678
  1. #!/usr/bin/env bash
  2. set -euo pipefail # bash strict mode
  3. unset -v latest
  4. for file in ./; do
  5. [[ $file -nt $latest ]] && latest=$file
  6. done
  7. echo "$latest"