diff mbox series

cpuset_inherit_test: compatibility fix for DASH

Message ID 20200928054043.17058-1-po-hsu.lin@canonical.com
State Accepted
Headers show
Series cpuset_inherit_test: compatibility fix for DASH | expand

Commit Message

Po-Hsu Lin Sept. 28, 2020, 5:40 a.m. UTC
The /bin/sh was symbolically link to dash in Ubuntu, in which the
"let" expression does not work, it will complain about:
    cpuset_inherit_testset.sh: let: not found

Fix it with double parentheses arithmetic expansion to improve the
compatibility.

Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
---
 .../cpuset/cpuset_inherit_test/cpuset_inherit_testset.sh        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Li Wang Sept. 28, 2020, 6:34 a.m. UTC | #1
On Mon, Sep 28, 2020 at 1:41 PM Po-Hsu Lin <po-hsu.lin@canonical.com> wrote:

> The /bin/sh was symbolically link to dash in Ubuntu, in which the
> "let" expression does not work, it will complain about:
>     cpuset_inherit_testset.sh: let: not found
>
> Fix it with double parentheses arithmetic expansion to improve the
> compatibility.
>
> Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
>

Pushed, thanks!
diff mbox series

Patch

diff --git a/testcases/kernel/controllers/cpuset/cpuset_inherit_test/cpuset_inherit_testset.sh b/testcases/kernel/controllers/cpuset/cpuset_inherit_test/cpuset_inherit_testset.sh
index 86856c3fb..73eed2cb9 100755
--- a/testcases/kernel/controllers/cpuset/cpuset_inherit_test/cpuset_inherit_testset.sh
+++ b/testcases/kernel/controllers/cpuset/cpuset_inherit_test/cpuset_inherit_testset.sh
@@ -106,7 +106,7 @@  inherit_test()
 test_cpus()
 {
 	cfile_name="cpus"
-	let "num=$nr_cpus-1"
+	num=$((nr_cpus-1))
 	cpu_string="0-$num"
 	if [ $nr_cpus -eq 1 ]; then
 		cpu_string="0"