From b7dced893a7de1c0ba303905f69022fee7d05fc9 Mon Sep 17 00:00:00 2001 From: rl1987 Date: Thu, 7 Feb 2019 17:05:14 +0200 Subject: [PATCH] Fix shellcheck SC2006 warnings in test_switch_id.sh --- changes/ticket29065 | 3 +++ src/test/test_switch_id.sh | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changes/ticket29065 diff --git a/changes/ticket29065 b/changes/ticket29065 new file mode 100644 index 0000000000..edf00ac99c --- /dev/null +++ b/changes/ticket29065 @@ -0,0 +1,3 @@ + o Code simplification and refactoring (shell scripts): + - Cleanup test_switch_id.sh to silence shellcheck warnings. Closes + ticket 29065. diff --git a/src/test/test_switch_id.sh b/src/test/test_switch_id.sh index 79c44f2eb1..b13bf7602f 100755 --- a/src/test/test_switch_id.sh +++ b/src/test/test_switch_id.sh @@ -1,11 +1,11 @@ #!/bin/sh -if test "`id -u`" != '0'; then +if test "$(id -u)" != '0'; then echo "This test only works when run as root. Skipping." >&2 exit 77 fi -if test "`id -u nobody`" = ""; then +if test "$(id -u nobody)" = ""; then echo "This test requires that your system have a 'nobody' user. Sorry." >&2 exit 1 fi