rehex ===== This program copies stdin to stdout and reformats any hexadecimal numbers. (C) Richard Harnden, 2009 Please report bugs: Public Domain. Use/copy at will. No warranties, etc. Building -------- cc rehex.c -o rehex Why? ---- The onstat commands don't use a consistent format when they print hexadecimal numbers. "onstat -g opn" uses "0x%.8x" "onstat -g ppf" uses "0x%x" "onstat -u" uses "%x" "onstat -C hot" uses "0x%.8X" (but "onstat -C clean" uses "0x%.8x") rehex reformats any hexadecimal numbers to "%x". ie, any 0x and extra 0s are removed. eg: The 'rstcb' column from 'onstat -g opn is the 'address' column in 'onstat -u', but with an extra "0x". The 'partnum' column from 'onstat -g opn' is the 'partnum' column in 'onstat -g ppf, but padded with extra '0's. etc Having everything in a consistent format makes it a lot easier to script things. Just pipe 'onstat -whatever' thru rehex. eg: "onstat -g ppf | rehex" -- @(#) $Id: README,v 1.1 2009/05/23 13:27:07 richard Exp $