Linux SED replace 0A with 1A

Viewed 157

I am working with car radio. OS here is QNX, and command set is very limited: enter image description here

I need to modify file in HEX. I've found sed command, which can do it, but as I've tried to use it, I've stuck.

I need to replace this byte order: 8A 00 00 0A B8 90 4B to -> 8A 00 00 1A B8 90 4B and I have no luck. I have found some codes on stackoverflow like sed ':a;N;$!ba;s/\n//g' file which removes 0A, so maybe possible to remove and append 1A. Are there any chances? Thanks in advance.

1 Answers

You were already very close. With GNU sed:

sed ':a;N;$!ba;s/\n/\x1A/g' file

or

sed ':a;N;$!ba;s/\x0a/\x1A/g' file
Related