]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mdcheck: replace deprecated "$[cnt+1]" syntax
authorMartin Wilck <mwilck@suse.com>
Thu, 14 Aug 2025 14:09:25 +0000 (16:09 +0200)
committerMariusz Tkaczyk <mtkaczyk@kernel.org>
Tue, 4 Nov 2025 07:51:28 +0000 (08:51 +0100)
This syntax used to be marked as deprecated [1]. In current bash
man pages, it isn't even mentioned any more. Use the POSIX compatible
syntax "$((X+=1))" instead [2, 3].

[1] https://stackoverflow.com/questions/41081417/difference-between-a-b-and-a-b-in-bash
[2] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_04
[3] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap01.html#tag_17_01_02_01

Signed-off-by: Martin Wilck <mwilck@suse.com>
misc/mdcheck

index e654c5c5d7454a26e04dc47992d0290da7931e4a..5ea26cdfaf2def47c9dcefd011b797b425b21a00 100644 (file)
@@ -129,7 +129,7 @@ do
                logger -p daemon.info mdcheck continue checking $dev from $start
        fi
 
-       cnt=$[cnt+1]
+       : "$((cnt+=1))"
        eval MD_${cnt}_fl=\$fl
        eval MD_${cnt}_sys=\$sys
        eval MD_${cnt}_dev=\$dev