read stdout line by line