From 6077d258b500b20e1e705f5cda567400240c7804 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 11:36:25 +0200 Subject: Adding upstream version 2.21.3+deb11u1. Signed-off-by: Daniel Baumann --- test/bashisms/arith.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/bashisms/arith.sh (limited to 'test/bashisms/arith.sh') diff --git a/test/bashisms/arith.sh b/test/bashisms/arith.sh new file mode 100644 index 0000000..2cbe860 --- /dev/null +++ b/test/bashisms/arith.sh @@ -0,0 +1,21 @@ +#!/bin/sh +metric=0 +echo $((metric=metric+1)) + +m=0 +n=2 +echo $((n-m++)) # BASHISM +echo $((++m)) # BASHISM +echo $(( m-- )) # BASHISM +echo $((--m)) # BASHISM + +foo_bar=0 +echo $((foo_bar++)) # BASHISM +echo $((foo_bar=foo_bar*2)) +echo $((foo_bar*3/6)) + +echo $((2*n++)) # BASHISM + +echo $(($n*n++)) # BASHISM + +echo $((3**2)) # BASHISM -- cgit v1.2.3