<div dir="ltr">Hi Subbu,<div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 17, 2018 at 4:44 AM, K K Subbu <span dir="ltr"><<a href="mailto:kksubbu.ml@gmail.com" target="_blank">kksubbu.ml@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class="gmail-"><br>
On Wednesday 16 May 2018 11:55 PM, Eliot Miranda wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
IMVER=`hexdump -n 4 -e '"%u\n"' "$IMAGE"`<br>
</blockquote>
<br></span>
od may be a better choice as it can handle endianness too. E.g.<br>
<br>
$ od -A n -t u4 -N 4 --endian=little squeak.image<br>
 6521<br>
$ od -A n -t u4 -N 4 --endian=big squeak.image<br>
 2031681536<br>
<br></blockquote><div><br></div><div>Doesn't work on Mac OS X:</div><div><br></div><div>Sisyphus.oscogvm$ od -A n -t u4 -N 4 --endian=little ~/Cog/SpurWork64.image</div><div>od: illegal option -- -</div><div>usage: od [-aBbcDdeFfHhIiLlOosvXx] [-A base] [-j skip] [-N length] [-t type]</div><div>          [[+]offset[.][Bb]] [file ...]</div><div><br></div><div>And when I used od on Mac OS X I found there is no option to eliminate the byte offset/data address printing.  Whatever we use has to work across as many Unix dialects as possible.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
The magic numbers may also be offset 512 bytes into the file:<br>
<br>
$ od -j 512 .......<br>
<br>
Regards .. Subbu<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>