Skip to content

Instantly share code, notes, and snippets.

View yyuu's full-sized avatar
👽
Working from home

YAMASHITA, Yuu yyuu

👽
Working from home
View GitHub Profile
@yyuu
yyuu / gist:931016
Created April 20, 2011 11:18
unit conversion in awk
function atoix(a) {
if(a~/Pi?B/) return int(a)*1024^5;
if(a~/Ti?B/) return int(a)*1024^4;
if(a~/Gi?B/) return int(a)*1024^3;
if(a~/Mi?B/) return int(a)*1024^2;
if(a~/Ki?B/) return int(a)*1024^1;
return int(a);
}
function itoax(i) {
hello, gist