From ee017c8c559f834dcd42d20d560cbaffe3846697 Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Fri, 21 Dec 2018 13:24:04 +0200 Subject: [PATCH] slight update to fastdu formatting --- files/fastdu | 10 ++++------ files/md5sum-update | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/files/fastdu b/files/fastdu index 6ab40b0..32d077c 100755 --- a/files/fastdu +++ b/files/fastdu @@ -24,9 +24,8 @@ function filesize() { split("B kB MB GB TB PB EB ZB", type) for(i=7;y < 1;i--) y = x / (2^(10*i)) - str=int(y*10)/10 type[i+2] - if (i==-1) { str = x "~B" } - print str + if (i==-1) { printf( "%d~B", x) } + if (i>-1) { printf( "%0.1f%s", y, type[i+2]) } }' || return $? } function siprefix() { @@ -41,9 +40,8 @@ function siprefix() { split("# k# M# G# T# P# E# Z#",type) for(i=7;y < 1;i--) y = x / (10^(3*i)) - str=int(y*10)/10 type[i+2] - if (i==-1) { str = x "~#" } - print str + if (i==-1) { printf( "%d~#", x) } + if (i>-1) { printf( "%0.1f%s", y, type[i+2]) } }' || return $? } diff --git a/files/md5sum-update b/files/md5sum-update index db9d179..2bd0f6b 100755 --- a/files/md5sum-update +++ b/files/md5sum-update @@ -6,7 +6,7 @@ Usage: md5sum-update [-r] [list name] -r recursive list name is md5sums.txt by default - Check files with "md5sum -m m5sums.txt" + Check files with "md5sum -c m5sums.txt" ' exit }