From: mitty Date: Thu, 7 Mar 2013 16:14:51 +0000 (+0000) Subject: * add function hexcmp: compare two binary files and show differences X-Git-Url: http://lab.mitty.jp/git/?a=commitdiff_plain;h=7ee0f52f2c0c03deade3af3af3b68be80e37f8b9;p=lab.git * add function hexcmp: compare two binary files and show differences * code from http://superuser.com/questions/125376/how-do-i-compare-binary-files-in-linux git-svn-id: https://lab.mitty.jp/svn/lab/trunk@200 7d2118f6-f56c-43e7-95a2-4bb3031d96e7 --- diff --git a/TipAndDoc/.bashrc b/TipAndDoc/.bashrc index 4b743ec..359a7a9 100644 --- a/TipAndDoc/.bashrc +++ b/TipAndDoc/.bashrc @@ -42,6 +42,10 @@ function svnst { svn st $@ | grep "^[^?]" } +function hexcmp { + cmp -l $@ | awk '{printf "%08X %02X %02X\n", $1-1, strtonum(0$2), strtonum(0$3)}' +} + alias vi='vim' alias sudo='sudo -H ' alias rm='rm -v'