echo -en 'hello\nyou\nthere' | sed -z "s/\(.\)/'\1\x0/g" | xargs -0 printf '%02x'
68656c6c6f0a796f750a7468657265
echo '68656c6c6f0a796f750a7468657265' | sed 's/\(..\)/\\\\x\1/g' | xargs printf
hello you there