From 0f5c2d8febc7446856104eb2143f75ddd6b98510 Mon Sep 17 00:00:00 2001 From: CuttySark1869 Date: Sun, 5 Mar 2023 20:38:50 +0000 Subject: [PATCH] fix count + 1 bug --- pishrink.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/pishrink.sh b/pishrink.sh index ab4e146..fc3dac4 100755 --- a/pishrink.sh +++ b/pishrink.sh @@ -411,6 +411,7 @@ else #Skip truncate if input is device fdiskresult=$(fdisk -l "$img") count=$(tail -1 <<< "$fdiskresult" | tr -s ' ' | cut -d ' ' -f 3) bs=$(head -3 <<< "$fdiskresult" | tail -1 | tr -s ' ' | rev | cut -d ' ' -f 2 | rev) + count=$(expr "$count" + 1) dd if="$img" of="$target" bs="$bs" count="$count" img="$target" else