Update reader.sh

handle eof