selftests: vm: fix shellcheck warnings in run_vmtests.sh
authorAxel Rasmussen <axelrasmussen@google.com>
Fri, 29 Apr 2022 06:16:11 +0000 (23:16 -0700)
committerakpm <akpm@linux-foundation.org>
Fri, 29 Apr 2022 06:16:11 +0000 (23:16 -0700)
commit241ec63a9a0fbb39292ea1dd2d07f8dabedfe3df
treeca5cb53b2115d03939158022527a8e0f08718be5
parentb67bd551201a3e2c7e1def84980e9b2f0b3a3c77
selftests: vm: fix shellcheck warnings in run_vmtests.sh

These might not be issues yet, but they make the script more fragile.
Also by fixing them we give a better example to future readers, who might
copy/paste or otherwise re-use snippets from our script.

- Use "read -r", since we don't ever want read to be interpreting '\'
  characters as escape sequences...
- Quote variables, to deal with spaces properly.
- Use $() instead of the older and harder-to-nest ``.
- Get rid of superfluous "$" prefixes inside arithmetic $(()).

Link: https://lkml.kernel.org/r/20220421224928.1848230-2-axelrasmussen@google.com
Signed-off-by: Axel Rasmussen <axelrasmussen@google.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/vm/run_vmtests.sh