From e04d6b7bf58a95105a8fc79fcde7c0e98875e72a Mon Sep 17 00:00:00 2001 From: a1346054 <36859588+a1346054@users.noreply.github.com> Date: Tue, 13 Sep 2022 18:42:15 +0000 Subject: tests: directly test for presence of command Test directly for presence of command instead of indirectly testing the return code. Additionally: * uses a shell builtin `command -v` instead of external `which` * `command -v` is the standardized version of `which` --- contrib/gdb-firejail.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/gdb-firejail.sh b/contrib/gdb-firejail.sh index 397438e1e..35348088e 100755 --- a/contrib/gdb-firejail.sh +++ b/contrib/gdb-firejail.sh @@ -17,7 +17,7 @@ if [ -z "${1##*/firejail}" ]; then else # First argument is not named firejail, then add default unless environment # variable already set. - set -- ${FIREJAIL:=$(which firejail)} "$@" + set -- ${FIREJAIL:=$(command -v firejail)} "$@" fi bash -c "kill -STOP \$\$; exec \"\$0\" \"\$@\"" "$@" & -- cgit v1.2.3-54-g00ecf