read cmds with line breaks, cleanup output