shell: last line was missing some times