]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Clean up lib/dg-add-core-file-count.sh
authorTom de Vries <tdevries@suse.de>
Sat, 15 Jun 2024 06:10:44 +0000 (08:10 +0200)
committerTom de Vries <tdevries@suse.de>
Sat, 15 Jun 2024 06:10:44 +0000 (08:10 +0200)
Fix shellcheck warnings in script lib/dg-add-core-file-count.sh.

Tested on x86_64-linux.

Approved-by: Kevin Buettner <kevinb@redhat.com>
gdb/testsuite/lib/dg-add-core-file-count.sh

index 45cf0cf3bd5414170e94bd5de8c92d0e717e5a61..b4cb6b93ea49aecd47a9555b7263a019a5b5ba4d 100755 (executable)
@@ -26,7 +26,7 @@
 # find, wc, etc.  Spawning a subshell isn't strictly needed, but it's
 # clearer.  The "*core*" pattern is this lax in order to find all of
 # "core", "core.PID", "core.<program>.PID", "<program>.core", etc.
-cores=$(set -- *core*; [ $# -eq 1 -a ! -e "$1" ] && shift; echo $#)
+cores=$(set -- *core*; [ $# -eq 1 ] && [ ! -e "$1" ] && shift; echo $#)
 
 # If no cores found, then don't add our summary line.
 if [ "$cores" -eq "0" ]; then