diff options
author | a1346054 <36859588+a1346054@users.noreply.github.com> | 2022-09-13 18:42:15 +0000 |
---|---|---|
committer | a1346054 <36859588+a1346054@users.noreply.github.com> | 2022-09-13 22:37:18 +0000 |
commit | e04d6b7bf58a95105a8fc79fcde7c0e98875e72a (patch) | |
tree | 6e20913ed5d4af3e1b0ef5a31ef80ee42f651376 /contrib | |
parent | tests: fix unintentional overwriting of array value (diff) | |
download | firejail-e04d6b7bf58a95105a8fc79fcde7c0e98875e72a.tar.gz firejail-e04d6b7bf58a95105a8fc79fcde7c0e98875e72a.tar.zst firejail-e04d6b7bf58a95105a8fc79fcde7c0e98875e72a.zip |
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`
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/gdb-firejail.sh | 2 |
1 files changed, 1 insertions, 1 deletions
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 | |||
17 | else | 17 | else |
18 | # First argument is not named firejail, then add default unless environment | 18 | # First argument is not named firejail, then add default unless environment |
19 | # variable already set. | 19 | # variable already set. |
20 | set -- ${FIREJAIL:=$(which firejail)} "$@" | 20 | set -- ${FIREJAIL:=$(command -v firejail)} "$@" |
21 | fi | 21 | fi |
22 | 22 | ||
23 | bash -c "kill -STOP \$\$; exec \"\$0\" \"\$@\"" "$@" & | 23 | bash -c "kill -STOP \$\$; exec \"\$0\" \"\$@\"" "$@" & |