Removed extrad CR when printing the output from -R
Handle errno.EAGAIN on stdin.read