bash read line handle case of no newline at end of file

Developer from somewhere

Found the answer here:

while IFS= read -r LINE || [[ -n "$LINE" ]]; do
  echo "$LINE"
done