From 480de7c63d93e8b8cd0c6ff55606bbb4015cb8ad Mon Sep 17 00:00:00 2001 From: Tao Liu Date: Nov 09 2021 12:39:02 +0000 Subject: bash scripts: get rid of expr and let upstream: fedora resolves: bz2003832 conflict: none commit c4d85142be300814b8818fe8aad65eaa042e01c8 Author: Kairui Song Date: Wed Aug 4 15:18:59 2021 +0800 bash scripts: get rid of expr and let As suggested by: https://github.com/koalaman/shellcheck/wiki/SC2219 Signed-off-by: Kairui Song Acked-by: Philipp Rudo Signed-off-by: Tao Liu --- diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index f354f45..61599e5 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -196,7 +196,7 @@ cal_netmask_by_prefix() { _res="$_first_part" _tmp=$((_octets_total*_bits_per_octet-_prefix)) - _zero_bits=$(expr $_tmp % $_bits_per_group) + _zero_bits=$((_tmp % _bits_per_group)) if [[ "$_zero_bits" -ne 0 ]]; then _second_part=$((_max_group_value >> _zero_bits << _zero_bits)) if ((_ipv6)); then diff --git a/kdumpctl b/kdumpctl index 42eaa28..d2d10ca 100755 --- a/kdumpctl +++ b/kdumpctl @@ -741,7 +741,7 @@ check_and_wait_network_ready() fi cur=$(date +%s) - let "diff = $cur - $start_time" + diff=$((cur - start_time)) # 60s time out if [ $diff -gt 180 ]; then break; @@ -804,7 +804,7 @@ show_reserved_mem() local mem_mb mem=$(