summaryrefslogtreecommitdiff
path: root/.local/bin/convwall
diff options
context:
space:
mode:
authorxyz <gky44px1999@gmail.com>2021-08-13 01:46:46 -0700
committerxyz <gky44px1999@gmail.com>2021-08-13 01:46:46 -0700
commit937b047c2a08e99cfd2a329d94ed34a041b9744a (patch)
tree8a30606797b50e4e59d09bd545bb92596ce669b4 /.local/bin/convwall
parent9d2921387f91f32dd4fba4ed3ced60682a03ee39 (diff)
use $(()) intead of echo to bc
Diffstat (limited to '.local/bin/convwall')
-rwxr-xr-x.local/bin/convwall8
1 files changed, 4 insertions, 4 deletions
diff --git a/.local/bin/convwall b/.local/bin/convwall
index 9db84d06..7ef49a9f 100755
--- a/.local/bin/convwall
+++ b/.local/bin/convwall
@@ -9,16 +9,16 @@ chopnum=99%
width=$(identify -format '%w' "$1")
height=$(identify -format '%h' "$1")
-ratio=$(echo "$wratio*100/$hratio" | bc)
-dim=$(echo "$width*100/$height" | bc)
+ratio=$((wratio*100/hratio))
+dim=$((width*100/height))
if [ "$dim" -ne "$ratio" ]; then
if [ "$dim" -lt "$ratio" ]; then
chopgeom="${chopnum}x0"
- width=$(echo "$height*$wratio/$hratio" | bc)
+ width=$((height*wratio/hratio))
else
chopgeom="0x$chopnum"
- height=$(echo "$width*$hratio/$wratio" | bc)
+ height=$((width*hratio/wratio))
fi
# may throw error "sort: write failed: 'standard output': Broken pipe \n sort: write error"
# caused by head exit (or close stdin) before sort output complete, can ignore