Fixed newline handling of command output in test script.