-1

I am converting binary data into hex and viewing this hex data in head from a continuous stream. I run the following where the conversion is from here

echo "ibase=2;obase=10000;$(echo `sed '1q;d' /Users/masi/Dropbox/123/r3.raw`)" \ 
                                                                               \ 
| bc                                                                           \
                                                                               \  
| head

and I get

(standard_in) 1: illegal character: H

so wrong datatype.

How can you do the conversion form binary to binary ascii by a single command efficietly?

xhienne
  • 5,535
  • 1
  • 14
  • 33
Léo Léopold Hertz 준영
  • 126,923
  • 172
  • 430
  • 675

1 Answers1

0

I run the following code based on Wintermute's comment

hexdump -e '/4 "%08x\n"' r3.raw 

For instance, head r3.raw | hexdump -e '/4 "%08x\n" gives

ffffffff
555eea57
...
Léo Léopold Hertz 준영
  • 126,923
  • 172
  • 430
  • 675