# follow and seek in a file being piped through a filter, in less
lessx() {
  [ -f "$1" ] || {
    echo "First argument must be a file"
    return 1
  }
  tmpfile=$(mktemp /tmp/"$(basename "$1.XXXXXX")")
  [ -f "${tmpfile}" ] || {
    echo "mktemp failed"
    return 1
  }
  tail -f "$1" | stdbuf -i0 -o0 sed 's:\\\?\\n:\n:g' >"${tmpfile}" &
  less +F "${tmpfile}"
  kill %% # kill the tail pipeline, after less exits
  rm "${tmpfile}"
}
