Strip newline from output of one command before feeding it to another