#!/bin/sh -e
#
# ct - cat latest with fzf

find=$(command -v gfind || echo find)
case "$#" in
  0)
    ${find} -L . -type f -exec ls -Atp -- {} + \
      | fzf --bind "enter:become(cat {})"
    ;;
  1)
    ${find} -L . -type f -exec ls -Atp -- {} + | head -n"$1" \
      | fzf --bind "enter:become(cat {})"
    ;;
esac
