[tor-commits] [tor/master] Fix shellcheck SC2006 warnings in test_switch_id.sh

nickm at torproject.org nickm at torproject.org
Sun Feb 24 22:02:41 UTC 2019


commit b7dced893a7de1c0ba303905f69022fee7d05fc9
Author: rl1987 <rl1987 at sdf.lonestar.org>
Date:   Thu Feb 7 17:05:14 2019 +0200

    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(-)

diff --git a/changes/ticket29065 b/changes/ticket29065
new file mode 100644
index 000000000..edf00ac99
--- /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 79c44f2eb..b13bf7602 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





More information about the tor-commits mailing list