Fix shellcheck SC2006 warnings in test_switch_id.sh

This commit is contained in:
rl1987 2019-02-07 17:05:14 +02:00 committed by Nick Mathewson
parent bfd1d70243
commit b7dced893a
2 changed files with 5 additions and 2 deletions

3
changes/ticket29065 Normal file
View File

@ -0,0 +1,3 @@
o Code simplification and refactoring (shell scripts):
- Cleanup test_switch_id.sh to silence shellcheck warnings. Closes
ticket 29065.

View File

@ -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