On 23/06/09 09:20, Thomas Viehmann wrote:
Hi,
Harry Rickards wrote:
Section : math
AntiHex is a pipe to convert hex values into decimal. Ex: # cat
/proc/iomem 00000000-0009fbff : System RAM 0009fc00-0009ffff : reserved
.... # cat /proc/iomem | ah 00000000-639K-1 : System RAM 639K -640K-1 :
reserved ...
I'm not sure the equivalent of
python -c 'import re,sys ; exec("""for l in sys.stdin: \
sys.stdout.write(re.sub(r"(?<![0-9A-Fa-f])[0-9A-Fa-f]{3,8}(?![0-9A-Fa-f])",\
lambda x: ((lambda y: (y>2**30 and ("%.2f"%(y/2.0**30))+"G") or \
(y>2**20 and ("%.2f"%(y/2.0**20))+"M") or (y>2**10 and \
("%.2f"%(y/2.0**10))+"K") or str(y))(int(x.group(),16))),l))""")'
qualifies as "math". And yes, I know that ah is much superior because it
has the "-1" business.
Kind regards
T.
It's not actually my program, it's just a useful tool I found on
Sourceforge. What would you suggest packaging it as? utils?
--
To UNSUBSCRIBE, email to debian-wnpp-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org