From 98c301e7b9215e113eb3eb2acc031c1af56bc0eb Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 5 Dec 2019 20:11:19 +0100 Subject: [PATCH] Letting round_down_div_million() convert small numbers to 0 --- xorriso-dd-target/xorriso-dd-target | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/xorriso-dd-target/xorriso-dd-target b/xorriso-dd-target/xorriso-dd-target index d378e017..7edf05a8 100755 --- a/xorriso-dd-target/xorriso-dd-target +++ b/xorriso-dd-target/xorriso-dd-target @@ -117,8 +117,18 @@ print_usage() { # Roughly convert human readable sizes and plain numbers to 1 / million round_down_div_million() { - sed -e 's/\.[0-9]*//' -e 's/[0-9][0-9][0-9][0-9][0-9][0-9]$//' \ - -e 's/[Mm]//' -e 's/[Gg]/000/' -e 's/[Tt]/000000/' + sed \ + -e 's/^[0-9][0-9][0-9][0-9][0-9][0-9]$/0/' \ + -e 's/^[0-9][0-9][0-9][0-9][0-9]$/0/' \ + -e 's/^[0-9][0-9][0-9][0-9]$/0/' \ + -e 's/^[0-9][0-9][0-9]$/0/' \ + -e 's/^[0-9][0-9]$/0/' \ + -e 's/^[0-9]$/0/' \ + -e 's/\.[0-9]*//' \ + -e 's/[0-9][0-9][0-9][0-9][0-9][0-9]$//' \ + -e 's/[Mm]$//' \ + -e 's/[Gg]$/000/' \ + -e 's/[Tt]$/000000/' } ### Assessing arguments and setting up the job