0

I am writing bytes to file using echo command. This in general works fine. But I have issue when my quotation sign is inside the bytes. To me it looks like escaped, but somehow I get error message in shell. How do I need to escape it here?

echo -n -e '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00d\x00\x00\x00\x1e\x08\x02\x00\x00\x00U9,\xa4\x00\x00\x00\xedIDATx\x9c\xed\x97K\x0e\xc3 \x0cDK\xd5#\xc0\xfd\x0fh\x0e\xd1\x05\x92k\x99\xefHq\xdaJ\xf3V\x04A<z!$\xa4\x9c\xf3\x83\x9c\xf1\xfcv\x80\x7f\x82\xb2\x00(\x0b\x80\xb2\x00^\xd0h\x91\xaa\xedR\xf2\xb0\'\x8eY-\xed\x8f\x0e\xf0YY"\xb5Um\r\x9b\xccFt\x81\xfa\x9e-\xb6\x90\xbd\xdc2\xab\x15\xedH\x99\xae,\xb7p\xa0@\xebY\xa5dggX\xab]\xda\xc1\xc3\xbb\x1d\x8a\xbe\x04\xbfg\xd9\xda\x1a\x17\xcat\xd5\xac\xbe\xbd\x9eu\x03^V_8\xe8\xd1\xd97qM\x8bt\x9b\x91\x05\xfb\r>"\xe5\xf6\xe5\xfaM\x92\x1ew\x86{\x84\xfb\x00\x1d.\x84\x13\x11"\xb5\x8d\xd41\xc3=k\xd63\x8b\x14\xaa>\xf1lx\x0e\x7fJ\x01(\x0b\x80\xb2\x00(\x0b\x80\xb2\x00(\x0b\x80\xb2\x00(\x0b\x80\xb2\x00(\x0b\x80\xb2\x00(\x0b\x80\xb2\x00(\x0b\x80\xb2\x00(\x0b\x80\xb2\x00\xde\n\x91\x87:\x13x\xae\x1f\x00\x00\x00\x00IEND\xaeB`\x82' > /tmp/message.png
Rene P
  • 1
  • 1

0 Answers0